Jump to content

Mouse Click Event


falsebeard
 Share

Recommended Posts

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 code

function 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

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...