简体   繁体   中英

libGDX about OrthographicCamera

I'm trying to do a game like Mega Jump.

Now I have a problem: I have no idea how to get on all devices the same number of columns for items. And how to get the player get to the opposite of the screen if he reaches the screen end.

I'm working whith a OrthographicCamera and box2d.

for all devices you could use Viewports and for the screen end you should calculate the dimensions(Gdx.graphics.getWidth or Gdx.graphics.getHeight). The player should be actor so create a stage and a group, add group to the stage and actor to the group. Hope this may help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM