Matter: Is sprite moving?

Hello guys

I would like to know if there is a way, after applying thrust to a matter sprite, to know if the sprite has fully stopped. Any suggestions? Big noob here hehe.

Thanks!

I used matter a bit. Never heard of thrust. Do you mean applyForce()?

Can’t you just check the sprite’s velocity?

The thrust is very well explained here: http://labs.phaser.io/edit.html?src=src\physics\matterjs\rotate%20body%20with%20cursors.js

That’s the example I used to move my character (a boat on the sea).

Check the velocity would help! Can you tell me how to do it? Thanks!

Sorry about that.

I think it was sprite.body.velocity.x and sprite.body.velocity.y

Try to log the sprite’s body console.log(sprite.body) to find it.

(I’m sorry, I’m on my phone and can’t check it)

1 Like

Thanks Yannick for your answer. Unfortunately it did not work for my project. What I ended up doing was instead, listening for the release of the “move forward” key.

1 Like