Hi guys, I’m trying to make a Snake Clone and I have this code.
if(_timer < 10000){
_timer += FP.elapsed;
}else{
_timer -= 10000;
move();
moveEntities();
}
Basically what I want it to do is to wait one second then it should move. All of this is in the update method of the Entity. Now I think this should work but whenever I run it, the Snake goes zooming very fast like it’s calling the move() and moveEntities() function everytime it updates. Changing the amountof milliseconds doesn’t change anything.
Any insight on what I’m doing wrong here?
The move() and moveEntities() are just functions that enable the snake to move a tile at a time with conditions on control etc… so I don’t think the problem is in those methods.