0

I developed a browser game using Craftyjs, but I noticed that it doesn´t work on tablets even using browser there.

Something strange happens as, the first click I make in the game from 7 options I have, always works fine, but the second click never works.

My question is: What can I do in order to make Craftyjs generated buttons to work in tablets (Android and iPad).

Here I have some example buttons:

btnLearn = Crafty.e "HTML"
btnLearn.attr x: 70, y: 527, w: 407, h: 54
btnLearn.replace """<div id="learn-mode" class="temple-learn">#{__("NEW SKILL")}</div>"""

btnScroll = Crafty.e "HTML"
btnScroll.attr x: 500, y: 527, w: 407, h: 54
btnScroll.replace """<div id="scroll-mode" class="temple-scroll temple-learscroll">#{__("USE SCROLL")}</div>"""

registry = Crafty.e "HTML"
registry.attr {x: 356, y: 504, w: 243, h: 68}
registry.replace """<div id="btn-tower-registry" class="new-btn-golden block-center"><span>#{__("REGISTER")}</span></div>"""

$("#btn-tower-registry").click( -> 
  gAgent.tower("Registry")

  # Premium dialog
  if window.profile_data.objects[0].premium
    loader.show()
    preloadScene(CFG.ASSETS_REGISTRY_STUDENT, -> Crafty.scene "registry")
  else
    premiumDlg2("tower_premium.png")
)

Hope it helps.

Sascuash
  • 3,661
  • 10
  • 46
  • 65
  • This should have been solved in the version 0.6.1 of Crafty.js. Which version do you use? – Kevin Simper Mar 03 '14 at 10:40
  • Crafty v0.5.3. It's possible to make it auto-update without making possible dependency fails? – Sascuash Mar 03 '14 at 12:10
  • I've just updated Crafty and for the moment it seems to work all fine in local. I'll test it in browser for 2~3 days and then in mobile. @KevinSimper If it works, you could repeat it as an answer so I can tag it as solved – Sascuash Mar 03 '14 at 12:26
  • It is not possible to auto-update, but you can install via bower by using `bower install crafty` :) – Kevin Simper Mar 03 '14 at 12:30

1 Answers1

1

This should have been solved in the version 0.6.1 of Crafty.js.

You can install the newest version the easiest with bower:

bower install crafty
Kevin Simper
  • 1,669
  • 19
  • 32