Looking for example of how to make a game bigger than 1 screen

Hi All,

I read the “Corona SDK Mobile Game Development” book. The examples were only 1 screen big for a mobile phone. I am looking for an example of how to write a multi-screen game like Doodle Jump, Angry Bird, or Lep’s World 2. I am just looking for some basic code, or video that would show how to have a game map that is larger than 1 screen. I’ve been unable to find an example on line so far. I guess I haven’t looked in the right places.

Thanks! [import]uid: 128770 topic_id: 34295 reply_id: 334295[/import]

Doodle Jump actually is only “one screen” where new platforms are generated on top, moved through the screen and removed when it left the screen. there are plenty of tutorials that use a game logic like this here http://learningcorona.com/

To make a world like in Angry Birds (by the way: it’s also written in LUA) you just create a display group that is bigger than the screen, put everything world-related in it and move it around.

-finefin [import]uid: 70635 topic_id: 34295 reply_id: 136348[/import]

Before submitting this question, I did go to http://learningcorona.com/.

As Peach has left Corona, the following is listed when you click on the links:

Maintenance Mode
As of today, Monday 10th December 2012, I am no longer a part of Corona Labs.
Techority now resides at http://base.techority.com/ - you will find all new posts located there, with new tutorials coming soon. [import]uid: 128770 topic_id: 34295 reply_id: 136352[/import]

There should be other tutorials there besides Peaches that can give you start on this.

Anyway the concept is simple, but depending on scale can take a little effort to get working. In the simplest of setups you would have say a 2048x2048 background (max texture size on some devices) and you scatter your objects around in that space. Clearly your 320x480 screen can’t show it all, so it becomes your “viewport” or “camera” on the world. As you move your player/actor around, you have code to move the world instead of the player. You can look around in the Community code or google for “Corona SDK Camera” and ignore the ones talking about taking photos. That will give you a good start.

Most likely though because of max texture sizes and wanting to have the ability to use higher resolution images, you are likely going to have to use a technique where your world’s background is made up of smaller images called tiles. Once you place all of the tiles so they line up seemlessly, then everything goes in to a display.newGroup. Lets say you move your player 5 pixels to the right, you would move the player 5px within the group but move the whole group 5px to the left so your player appears to stay centered and the world moves around him. Of course when you near the edges of the world, you stop moving the camera and just move the player. [import]uid: 199310 topic_id: 34295 reply_id: 136364[/import]

Thanks for the quick response, and for pointing me in the right direction. I did a quick internet search, and found many entries for “corona sdk tilemap”, and “corona sdk camera”. Also, thanks for info about “Doodle Jump”. It may be a simplier solution to what I seek. Any way, I now have plenty of resources to learn what I need. Thanks. [import]uid: 128770 topic_id: 34295 reply_id: 136403[/import]

I’ve made a library for that:

http://developer.coronalabs.com/code/perspective [import]uid: 147322 topic_id: 34295 reply_id: 136591[/import]

Thanks for sharing Caleb! [import]uid: 199310 topic_id: 34295 reply_id: 136598[/import]

Doodle Jump actually is only “one screen” where new platforms are generated on top, moved through the screen and removed when it left the screen. there are plenty of tutorials that use a game logic like this here http://learningcorona.com/

To make a world like in Angry Birds (by the way: it’s also written in LUA) you just create a display group that is bigger than the screen, put everything world-related in it and move it around.

-finefin [import]uid: 70635 topic_id: 34295 reply_id: 136348[/import]

Before submitting this question, I did go to http://learningcorona.com/.

As Peach has left Corona, the following is listed when you click on the links:

Maintenance Mode
As of today, Monday 10th December 2012, I am no longer a part of Corona Labs.
Techority now resides at http://base.techority.com/ - you will find all new posts located there, with new tutorials coming soon. [import]uid: 128770 topic_id: 34295 reply_id: 136352[/import]

There should be other tutorials there besides Peaches that can give you start on this.

Anyway the concept is simple, but depending on scale can take a little effort to get working. In the simplest of setups you would have say a 2048x2048 background (max texture size on some devices) and you scatter your objects around in that space. Clearly your 320x480 screen can’t show it all, so it becomes your “viewport” or “camera” on the world. As you move your player/actor around, you have code to move the world instead of the player. You can look around in the Community code or google for “Corona SDK Camera” and ignore the ones talking about taking photos. That will give you a good start.

Most likely though because of max texture sizes and wanting to have the ability to use higher resolution images, you are likely going to have to use a technique where your world’s background is made up of smaller images called tiles. Once you place all of the tiles so they line up seemlessly, then everything goes in to a display.newGroup. Lets say you move your player 5 pixels to the right, you would move the player 5px within the group but move the whole group 5px to the left so your player appears to stay centered and the world moves around him. Of course when you near the edges of the world, you stop moving the camera and just move the player. [import]uid: 199310 topic_id: 34295 reply_id: 136364[/import]

Thanks for the quick response, and for pointing me in the right direction. I did a quick internet search, and found many entries for “corona sdk tilemap”, and “corona sdk camera”. Also, thanks for info about “Doodle Jump”. It may be a simplier solution to what I seek. Any way, I now have plenty of resources to learn what I need. Thanks. [import]uid: 128770 topic_id: 34295 reply_id: 136403[/import]

I’ve made a library for that:

http://developer.coronalabs.com/code/perspective [import]uid: 147322 topic_id: 34295 reply_id: 136591[/import]

Thanks for sharing Caleb! [import]uid: 199310 topic_id: 34295 reply_id: 136598[/import]

I’ve been looking for a third party library like this one for hours! I was starting to despair, since i really needed that functionality in the game i’m building, and my own attempts at this have failed miserably.

Thank you so much! [import]uid: 215620 topic_id: 34295 reply_id: 141327[/import]

I’ve been looking for a third party library like this one for hours! I was starting to despair, since i really needed that functionality in the game i’m building, and my own attempts at this have failed miserably.

Thank you so much! [import]uid: 215620 topic_id: 34295 reply_id: 141327[/import]