Search code examples
javascriptcordovacraftyjs

Responding to Touch using Crafty


I'm trying to create a game using Crafty JS, that I eventually want to deploy via PhoneGap. Out of the box, the .fourway() method doesn't respond to touch on my Android device. Is there in-built support for touch? Is there a component I can use to add touch capabilities, or do I have to set this up manually?


Solution

  • Touch events in Crafty are normalised as Mouse events. fourway is specifically tied to keyboard events.

    You might have some joy using the moveTo component instead of fourway