Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
define gestureswipe event handlers for you jump and dodge objects. if those aren't objects, convert them.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now