1 decade ago by dexxa
while changing the angle of an entity, i encountered a problem. this is my code and it's in the update function.
it slows down to almost complete stop after 5 or 6 hundred runs of the update function. anyone know why?
if(this.direction == "up")
this.anims.idle.angle += 0.1;
else
this.anims.idle.angle -= 0.1;
if(this.anims.idle.angle < -1.1)
this.direction = 'up';
else if(this.anims.idle.angle > 0.3)
this.direction = 'down';
it slows down to almost complete stop after 5 or 6 hundred runs of the update function. anyone know why?
