CaueCR Posted January 21, 2014 Share Posted January 21, 2014 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!Cauê. Link to comment Share on other sites More sharing options...
BunBunBun Posted January 22, 2014 Share Posted January 22, 2014 look http://www.gametest.mobi/phaser/examples/sideview.html here you can read how to add card images and how to create mouse/touch events. Then compare "id" or other variable of cards to find the same. Link to comment Share on other sites More sharing options...
CaueCR Posted January 22, 2014 Author Share Posted January 22, 2014 Alright! I'll give it a look, thanks for the help! Link to comment Share on other sites More sharing options...
CaueCR Posted January 22, 2014 Author Share Posted January 22, 2014 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 More sharing options...
CaueCR Posted January 22, 2014 Author Share Posted January 22, 2014 Don't mind this topic anymore, I've already solved the problem with my counter xDThanks for the help! Link to comment Share on other sites More sharing options...
Recommended Posts