0

The background of my game is going to be scrolling. Instead of making it scroll by moving all the objects in relation to my main character, I want to just move the camera to follow him.

I could do that with g.translate(x,y) in java but what is the equivalent in Android?

Also, if you want let me know your thoughts about if moving the camera is the best choice. Why does everyone just make the background move, and not the camera?

Thanks!

Chilledrat
  • 2,593
  • 3
  • 28
  • 38
Karl Floersch
  • 327
  • 4
  • 15

1 Answers1

1

I could do that with g.translate(x,y) in java but not sure how in Android.

The equivalent would be c.translate(xPos,yPos), where c is of type Canvas.

Also, if you want let me know your thoughts about if moving the camera is the best choice. Why does everyone just make the background move, and not the camera?

Probably because they are unaware they can apply matrix transformations to drawing operations.

K-ballo
  • 80,396
  • 20
  • 159
  • 169