Hi i am new to programming, and i am currently working on a game, but i seem to have hit a wall i have made two variables:
static var curXp : float = 0.0;
static var maxXp : float = 100.0;
and later in the code i am making it compare the two:
if( curXp === maxXp )
but the debug log gives me this:
‘is’ can’t be used with a value type (‘float’)
what do i have to do
Never compare two floats with “==”, instead use Math.Approximately().
And rethink do you really have to use float. In most cases you should be able
to use integer.