biklas7 Posted May 25, 2015 Share Posted May 25, 2015 Hello, I'm new to Phaser and i'm really getting into it. I've already made a couple of tutorials, and now i want to make my own game. In the game I'm trying to develop, when I press the screen with a touch or with the mouse, the player should move to the point I touched with a certain amount of acceleration. In the official Phaser examples i've got this piece of code: player.rotation = game.physics.arcade.moveToPointer(player, 600, game.input.activePointer, 600); With this code the player follows the mouse pointer and never stops unless the mouse is stopped, and i want to simply click or touch the screen and put the player moving to the point i've touched or clicked and stop there until i click or touch again in the screen. Can someone help me? Regards,António Link to comment Share on other sites More sharing options...
biklas7 Posted May 26, 2015 Author Share Posted May 26, 2015 I've kind of found a solution.. This code seems to work: if (game.input.mousePointer.isDown) { player.rotation = game.physics.arcade.moveToXY(player, game.input.x, game.input.y, 600, 600);} Anyway, if someone have a better solution it will be welcomed. jdnichollsc 1 Link to comment Share on other sites More sharing options...
Recommended Posts