Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

float and int need help

It, again, depends on your game. For more complex games, like RPGs, where
a lot of complex calculations are involved, like armor, resistances, 
different damage types, multipliers, crits and so on, you will want to use 
floats. If you have something like health regeneration over time, you 
will want to use floats as well since it makes it easier to add a fraction 
of a whole number per frame. For more simple games where you dont intend 
to go between full values (think games where the HP is represented
by hearts for example, and where you collect health as drops),
you can easily go with integers.

But, I would go with floats most of the time. It makes your life easier.
But in the end it depends on the design of your game.
Comment

PREVIOUS NEXT
Code Example
Csharp :: write last element of dictionary c# 
Csharp :: get x and y of mouse uinty 
Csharp :: how to run a c# program 
Csharp :: remove all array elements c# 
Csharp :: how to cap rigidbody velocity 
Csharp :: datetime check null c# 
Csharp :: unity custom editor 
Csharp :: how to pass optional guid parameters in c# 
Csharp :: unity get game version 
Csharp :: declare dictionary c# 
Csharp :: how to disable vsync in monogame 
Csharp :: toggle unity c# 
Csharp :: integer required asp.net core 
Csharp :: arcane 
Csharp :: unity get center of object 
Csharp :: Change Level in Unity 
Csharp :: asp.net mvc get current url in view 
Csharp :: convert html to pdf c# 
Csharp :: c# right function 
Csharp :: c# alphabetize a list of string 
Csharp :: c# close program 
Csharp :: how to destroy parent gameobject unity 
Csharp :: index of c# 
Csharp :: jenga db connection 
Csharp :: how to evaluate code in c# 
Csharp :: set margin programmatically wpf c# 
Csharp :: .net 6 autofac 
Csharp :: unity activate gameobject via script 
Csharp :: destroy gameobject with tag unity 
Csharp :: iterate though data in firebase unity 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =