Android Question general game question

ilan

Expert
Licensed User
Longtime User
hi

i would like to ask your opinions.
everybody knows the great game "hill climb"

i am working on a similar game now and i would to like to ask what would be the better scenario for that kind of game (libgdx+box2d).

i am creating a level with all bodies in it. the level length is 500 m (screen is about 18m)
i stick the camera position to the bike. everything is working ok. but should it be like this?

or should i move all objects to the left instead of moving the camera ??

the problem with moving the camera is that everything moves with it also buttons, score, background,...
that should stay at a fix position.

i can draw the textures with the updated camera position but this is causing small flickers from time to time.

what would be the right way?
 

sorex

Expert
Licensed User
Longtime User
moving the camera makes sense and saves you some object updating trouble and I guess the scores, button etc are in a static layer on top of it.

but as I never used GDX I don't know how it can be done with it.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
moving the camera makes sense and saves you some object updating trouble and I guess the scores, button etc are in a static layer on top of it.

but as I never used GDX I don't know how it can be done with it.

thanx sorex, actually it is much simpler than i thought. i just create two lgSpriteBatch.
1 is combined with the camera and for the second i create a lgMathMatrix4 with the world coordinate

creating a game takes lot of time and trying, trying, trying,.. but i am sure the second game will be much more fun :D

(i have also choosed a not so simple "first" game :confused:)
 
Upvote 0
Top