• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Drawing in the correct location in games

qoncept

Newbie
I'm playing with the Lunar Lander sample code to get a better understanding of how to draw the graphics in a 2d game (my background is more in GUI and database). One thing I've never quite understood is the positioning of an object.

The little bit I've done in the past (on PCs) is making sure I have a set width window. Then I move my objects around on a pixel grid. What is the best practice for placing an object when the screen can be different resolutions? I want the game to be the same on every platform, so do I draw it normally and transform the entire canvas? Is there a better reference for location than pixels? Looking at the Lunar Lander code, I'm having a hard time determining how it actually sets the position and whether it would look the same at different resolutions. Thanks in advance!
 
Back
Top Bottom