Dev Update #10 – A Resolution Independent Tower

As promised I will post some updates about what has happened with Game Tower in the last weeks.

Creating the actual tower with all it’s floors was a little more difficult than the creating the overlaying UI and the menu screens. The main problem here was the various resolutions that needed to be supported. It’s a mobile game and with the multitude of phones and screens out there, it needs to be basically resolution independent. Buttons and other nine-sliced UI elements can stretch or be anchored and adjust themselves to different resolutions fairly easily. But the individual floors inside the game area are a different matter.

The floors should adjust to the screen size, but without squishing or stretching the graphics. Because of the different screens, the width of the tower is unknown. The tower doesn’t have a fixed height either, since I can add more floors to it as I play. This made it slightly difficult to set everything up.
BlogPost10I want each floor to use the entire width of the screen. Of course the graphics shouldn’t be squished or stretched, so depending on the width each floor then adjust it’s height to match the original aspect ratio that I designed it for. This would mean that the floor graphics look the same on all devices, but the amount of floors that are visible on screen at the same time depends on the aspect ratio of the screen of the phone it is being played on. Thinner or longer phones would show more floors than wider or shorter ones.

The new Unity GUI system is still fairly new to me, so it took me a little longer to figure this one out. But it finally worked. My code now calculates each floor’s position from it’s height, and the height is calculated from the width. Technically the game can handle it if the screen is re-sized in the middle of the game. Even though that would be impossible on a real phone, it’s just something I feel good about. The floors and their content keep their aspect ratios and adjust with the screen resolution, and I can even already scroll through the tower by dragging up and down.

There are more updates coming, next up is a startup screen with gameplay tips!

Lots of progress, but not a lot of updates

I realize I haven’t posted since the new year started and hang my head in shame for that. I have been working on Game Tower quite a bit and have a lot of progress to show for it – but somehow I never found the time to post any updates.

Now with the GDC out of the way, things should slow down a little. In the next weeks I will start sorting through everything and post a few updates about what happened with the game since Christmas.