Faking a Swipe in Phaser

One of the advantages native programs like Java for Android or Swift for IOS has over web languages like HTML5 is having built-in detection for detecting swiping. But with a little bit of coding, we can detect the actions of a swipe. For that, we need to break down the action of a swipe

  1. The user touches the phone (mouseDown)
  2. The user moves a finger across the phone
  3. The user lifts their finger(mouseUp)

Example

Code

 
Source Code Available in the FILE VAULT!

Leave a Reply

Your email address will not be published. Required fields are marked *