isinstance float or int
#checks if var is float or integer
isinstance(var, (float, int))
isinstance float or int
#checks if var is float or integer
isinstance(var, (float, int))
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.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us