📜  float 和 int 需要帮助 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:43.630000             🧑  作者: Mango

代码示例1
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.