user1163028
user1163028

Reputation: 21

How to make a sprite fall in AndEngine Android

I'm a beginning game programmer, and I'm learning how to use AndEngine for Android. I'm trying to get a sprite to fall down the screen, and jump upwards when touched by the user. Any ideas on how to do this? I'm open to using other engines if that would make it easier.

Thanks!

Upvotes: 2

Views: 1331

Answers (2)

rubikonx9
rubikonx9

Reputation: 1413

You also could register a PhysicsHandler on the sprite to make it fall and override the sprite's onAreaTouched. Also don't forget to register the sprite as the touch area on the scene.

Upvotes: 0

Jong
Jong

Reputation: 9115

Use EntityModifiers. MoveYModifier could be used to move an entity across the Y axis (Either for falling, or jumping). Try it out.

These 2 questions may help: Using PathModifier or MoveYModifier to simulate sprite jumping and Making a sprite jump when user taps on the screen?

Upvotes: 2

Related Questions