Jump to content

Help with touch?


Recommended Posts

Hello! Sorry to bother with a possibly stupid question, but I really need help. I've started to use Phaser two days ago and I am trying to make a simple card game.

In this game, you have four cards in the screen, you click the equal ones, and you go to the next level. It's really simple, but I'm having trouble finding a tutorial or example about mouse/touch events. I really need to make it work with both the mouse and touch, because I'm aiming to try the game in the desktop and mobile browser.

I would really appreciate if anyone can help me, if necessary I can put my code here.

Any help would be welcome!

Thanks for your time!

Link to comment
Share on other sites

It's working! Thanks to BunBunBun and the "tanks" example! 

But I have another problem now, I have a counter that increments when I click on a card. The problem is, when I click the counter gets updated way too much.

When I click once, it increments 5 or 6 times. Anyone know a way for me to delimit that? I need it to increment exactly once per click.

Thanks for your time!

Link to comment
Share on other sites

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.

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.


  • Recently Browsing   0 members

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