I am using andengine to implement a sprite being able to be dragged across the screen using this.
So what i want to do is when the user taps any where on the screen make the sprite jump.
or move up and then move down.
What is the best way to go bout doing this with andengine?
This should work:
Keep in mind that, if you will use this, whenever there is an
ACTION_DOWNevent, you might miss some other event handlers for this (For example, if you have on-screen buttons, they will never handle the event).The way to handle it is to use add any other entities you want to receive touch events as touch areas for your scene,
Scene.registerTouchArea(ITouchArea)does so.Sprites andAnimatedSprites implementITouchArea, so you can use these.When a
Scenereceives aTouchEventto handle, it will first let all theITouchAreas you registered handle it, then if non of them consumed it, it will try theonSceneTouchEvenetmethod.