0

I am implementing a side scrolling android game. The player should move in a diagonal direction and the objects around him seem to move back ward.

I have structured my app like the open source project (replica island) by Chris Pruett.

I can render the obstacles and the player, but unable to move the obstacles.

Any help in this direction is greatly appreciated.

random
  • 10,238
  • 8
  • 57
  • 101

1 Answers1

0

First of all: I am not familiar with the source code of "Replica Island" (I've played the game, though).

If you want to move/physically manipulate objects in your world, I'd suggest you use a 2D physics engine. A good start would be jBox2D or chipmunk for Java. Both are very similar.

It is quite easy to integrate in a game and fun to use, but the approach of character controlling is quite different to a game without a physics engine. For example, you apply forces to your character to move him around and do not set his speed/position manually.

I'm sure you'll find plenty of examples and tutorials for both physics engines out there.

HTH

Constantinius
  • 34,183
  • 8
  • 77
  • 85