February 10, 2015 by Corey
I’ve been following burning the midnight oil for the past few days making this brick breaker clone. I’ve learned some really useful stuff about the relationship between screen resolution and the sometimes arbitrary sizes of things you put on the screen. Really simply, this is how the sizing in this games works:
- The resolution of an ipad is 2048 x 1536 (assuming I want this played on an ipad)
- The aspect ratio of that is 1.33 repeating (2048/1536=1.333). 800 x 600 also has the same aspect ratio; this is my game’s resolution
- I want the game area to be 16 bricks wide, which isn’t exactly an arbitrary choice. If you divide 2048 by 16 you get 128 precisely. As we all may have guessed by now, the width of a brick is 128 pixels.
- In order to correctly size my background image, I need to divide the resolution by that amount. 800 / 16 = 50. That 50 is the amount of pixels per unit (ppu) that my background needs to be. To be honest, I don’t fully understand PPU. What is a unit?!
- The paddle size is completely arbitrary. I plan on adjusting that, but the size should be just enough to be fair.
- Ball size (stop being immature) is also mostly arbitrary based on fairness.
These are great to keep in mind when I start sizing up my own game, but I’m also learning another equally important thing. Patience and not burning out. Two things but they’re basically on the same level. I have a lot to say, and a lot to learn but in short it really is this massive cliche: Rome wasn’t built in a day.
I already feel myself getting attacked by hipsters…
‘Till next time folks.