Skip to main content
Inspiring
October 28, 2013
Question

Gestures Please Help me Urgent

  • October 28, 2013
  • 1 reply
  • 351 views

Hi

So I have this code which controlls getures in my game

public function ScreenSwipe(e:TransformGestureEvent):void

{

                                    if(e.offsetY == -1 && e.stageX > 250)

                                     {

                                               V.P.gotoAndPlay("JumpDodge");

                                               V.SoundM.PlaySound(Sources.Dodge);

                                     }

                                     else if(e.offsetY == 1 && e.stageX > 250)

                                     {

                                               V.P.gotoAndPlay("DuckDodge");

                                               V.SoundM.PlaySound(Sources.Dodge);

                                     }

}

The problem is I need the gesture to call when you swipe any direction in the right area

if you dont understand what I mean I have attached a picture

So if you swipe anywhere in any direction in the jump area the player will jump.

Thanks

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
October 28, 2013

define gestureswipe event handlers for you jump and dodge objects.  if those aren't objects, convert them.