I have a sprite that moves along a loop of sprites. When the Up button is pushed, I call
n—; sprite.x=loop[n].x; sprite.y=loop[n].y;
It works great, and the sprite moves along the squares smoothly. However, it moves at a fixed speed, and I cannot figure out how to change it.
I have tried
this.matter.world.engine.timeStep=2 but instead of changing the sprites speed, it slows down everything else in the game.
Is there a way to change the speed of the update function for a particular sprite, so that I can slow down