Monday, 9 May 2016

Endless run and endless troubles 8)

I decided to take a small break from interactive stories (still working on Russian translation, and Android version of Koschei though) and get acquainted with Corona physics.
So from now on, at least until I released update for Koschei, I am going to work on my endless run game.

First, I thought about developing a platformer, but endless run is a bit easier to make.
Now I enjoy the "research" stage. I installed Temple Run, Subway surf, Jetpack, Joan Mad Run, Nyan Cat, Nosferatu and Rush City 8))

But I don't just play games, I actually started working on my own endless run and immediately ran into trouble (irony!).

I still use Corona, but this time I started with a setup for several devices. There's a very good tutorial about it and it actually works perfectly. Until I decided to load my stage.

At this point, I don't want to spend too much time optimising stuff - so I simply load an image and fill a rectangle with it, repeating it as many times as I need (actually there are 3 textures and 3 rectangles to create a parallax effect, but who cares 8))
And... Corona magically resizes it, but instead of fitting the screen based on base resolution, as it says in tutorial, it re-aligns it to the middle of the screen, making a margin at the top for iOS status bar.

The only fix I have found so far is:
Instead of using an example of actual device resolution by default (for instance 1024x768), I use an average resolution for all available devices (1136x710) and Corona adjusts it a bit, leaving out parts off the screen. Then I create background images with this resolution, keeping in mind that some parts of it will be omitted on different devices.

So, here it is, my first parallax (all textures are just for testing, they will be redrawn later)

No comments:

Post a comment