Side Scroller - Background with Varying Terrain

It’s been about 20+ years since I programmed anything and I am very new to Corona. I want to develop a side scroller game with a background that moves horizontally from right to left with a sprite (a car) moving across it. I’ve seen some examples of scrolling games but the backgrounds were always flat. I’d like my background to consist of rolling hills, etc, to give it more interest. Is this something that can be done and if so, how do I make the car ride along the varying terrain but also allow the player to make it jump over obstacles? Any suggestions & assistance with this would be appreciated since I’m not sure where to start.

Do any good books exist out there that help you learn programming in Corona? I think I could really use one.

Thanks Much! [import]uid: 123289 topic_id: 22070 reply_id: 322070[/import]

Hey Dave,

Take a look at this sample; https://github.com/ansca/TinyPenguin - that should be of help with the terrain side of things.

RE books, Dr Burton has one and there’s another one that I believe is due out next month by Michelle, who you can find on Twitter here; https://twitter.com/#!/chelleshock1219

There’s also http://learningcorona.com/ which has a massive list of tutorials and sample code. (I believe it contains pretty much every tutorial available.)

Peach :slight_smile: [import]uid: 52491 topic_id: 22070 reply_id: 87801[/import]

Peach,

Thank you so much for your help, the Tiny Penguim example is great! I was looking at the code and was wondering how would I make it so that in my game the car (or whatever i use) would stay back on the ground when it lands (or may have one or two small bounces before it did), it looks like the penguin keeps bouncing as soon as he hits. Also how would I make it so that when the user touches the screen my character would jump based on how long they touched it for? I would like there to be a limit on their jump height (a range of height based on the screen touch. I’ve seen examples sort of like this but it still is a bit of a mystery to me being new at this whole thing.

I’m going to look into the books you mentioned, do you have any books out yourself? You seem to know a ton about this stuff.

Thanks again!
Dave [import]uid: 123289 topic_id: 22070 reply_id: 87851[/import]

I haven’t looked at the code in a little while but RE the bounce, make sure that the ground and the car are both set to bounce=0 when you add their physical bodies.

If you have issues with that part let me know, I will download the code again (don’t have it since last wipe) and see how the bounce is controlled.

For jumping, we actually had a thread about that recently, where is it? … OK< apparently we had two threads and I can only find one, no matter! http://developer.anscamobile.com/forum/2011/08/05/jump-height-depending-how-long-you-hold-button

That has a discussion on jumping based on how long a button is held. Have a go at it, implement what you can then let me know if you are struggling with it and what parts are the issue and will try to further assist with those.

As to books, not yet - my energy is focused on Techority - however I am writing a book for new users, it’s just a slow, slow process :wink: Thanks for the kind words. [import]uid: 52491 topic_id: 22070 reply_id: 87999[/import]