0

I have some basic programming skills but Im new in game programming. Know that every game needs a game loop, something like while (true) { //do things } in separate thread. But i wonder how is a scrollabe background (2D) used to be realized (when pressing arrow, main character is in the middle of screen, but background and things are moving). How could a simplest example of code for android platform looks like?

Iriminage
  • 177
  • 2
  • 17

1 Answers1

0

Your best bet for starting Android game development would be a game engine. Game engines make core features of games simple to use. Personally I recommend and use LibGDX. LibGDX provides easy to use cameras that can be moved through a world.

To answer your question, create a world and a player class in LibGDX. Each frame you could update the camera's world position to match the player's world position.

John
  • 816
  • 5
  • 17