falsebeard Posted January 5, 2014 Share Posted January 5, 2014 Hello! Excuse me for very stupid question but I'm newbie in Phaser and in programming (and in English too ) I don't know how to activate function when user click left button (anywhere on the screen) I try to use this codefunction update () { if (game.input.onDown) { Shoot(bullet.x); }}(shoot - function which create bullet at coordinate of player) But with it "bullets" created one by one without clicking. I know how to do this with keysm but I want to use mouse. Help me, please.Thank you! Link to comment Share on other sites More sharing options...
rich Posted January 5, 2014 Share Posted January 5, 2014 Look at the code in the examples folder, specifically this one: examples/physics/shoot the pointer.js. It will show you exactly what you need Link to comment Share on other sites More sharing options...
falsebeard Posted January 5, 2014 Author Share Posted January 5, 2014 Thank you very much. I had to use "game.input.activePointer.isDown" instead "game.input.onDown". Also, I was searching for an example in directory "input", not in "physics". Link to comment Share on other sites More sharing options...
Huulktya Posted April 10, 2014 Share Posted April 10, 2014 Here is a link to the example referenced: http://examples.phaser.io/_site/view_full.html?d=arcade%20physics&f=shoot+the+pointer.js&t=shoot%20the%20pointer phaserlover and ashes999 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts