JamesAnd Posted December 11, 2017 Share Posted December 11, 2017 Hello, I would like to know if it is possible to have screen touch controls on mobile instead of the buttons? In my game i tried having buttons to jump and it functioned correctly... however I am looking for a way to make my character jump wherever we actually touch the screen and not just one specific button. is that possible? Also is it possible to have movement controls such as the attached in Phaser? is this a good example: https://phaser.io/examples/v2/input/virtual-gamecontroller Thank you! Link to comment Share on other sites More sharing options...
erich Posted December 13, 2017 Share Posted December 13, 2017 Hi you can use the this.game.input.activePointer.isDown to use the screen as a button - I used it in one of my original games http://html5gamer.mobi/phaser2/oscar/ I made so you can press a mouse button on the screen (mobile use) or you can press the up cursor on a computer to jump sample code if (this.cursors.up.isDown || this.game.input.activePointer.isDown){ this.playerJump(); } else if (this.cursors.up.isUp || this.game.input.activePointer.isUp){ this.isJumping = false; } Hope that helps Eric Link to comment Share on other sites More sharing options...
Recommended Posts