Hello. So i have my enemy’s speed declared as number. something like this:
private var speed:Number=1;
When the enemy sees player in his front, and he respect a certain condision, like this:
if (collide("player", x, y)&& (x - 40.5) % 17==0)&&(y - 31) % 17==0)
The enemy should have speed from 1 to 1.7.
The problem is that his x for example will not be increassed by 1.7 each frame but by a very weird number becose if i select him in concole and watch his x ,his x is like 122.10000000000011 or something like this.
After some more research i found that any speed that is not a integer number will the have same problem. Any ideas?