Question

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.

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top