Pietari Posted April 4, 2016 Share Posted April 4, 2016 When i click, the object moves in the direction of the mouse click and will stop if i press spacebar. How can i do this? Link to comment Share on other sites More sharing options...
michaelcalkins Posted April 4, 2016 Share Posted April 4, 2016 Here's one resource to start with: http://phaser.io/examples/v2/input/follow-mouse This example stops when you release your mouse click though. You'll need to track: Where the object is moving to Whether or not the object is currently moving If the spacebar is pushed change the bool on the object to false to stop it's movement Link to comment Share on other sites More sharing options...
Recommended Posts