Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Basic side scroller code

edited June 2013 in Code Sharing Posts: 725

Here is a simple side scroller. It's aimed at helping beginners understand some of the basics involved in meshes, spritesheets and collision detection. It's by no means perfect but hopefully someone will find it useful. I've included a spritesheet which you are free to use, modify, whatever.

Code:https://gist.github.com/Westenburg/5743643

Spritesheet:https://www.dropbox.com/s/ztwc51abhl3ks1k/foggyspritesheet@2x.png

Video of gameplay:

Comments

  • IgnatzIgnatz Mod
    Posts: 5,396

    Cool. I aim to write some tutorials about sidescrollers, so I'll read this with interest.

  • edited June 2013 Posts: 18

    Cool, but i have only a Blue/withe screen. I have downloaded your Image and put it in the dropbox and activated it in the code.

  • Posts: 725

    Try saving it to documents. You also might want to rename the file to something simpler.

  • BriarfoxBriarfox Mod
    Posts: 1,542

    @west Very cool. Wish I would have had this to reference on my last side scroller. Really informative!

  • Posts: 63

    Cool, it's nice :)

  • Posts: 18

    @West Thank you, it works.
    I can't find a exit option to codea.

  • Posts: 77

    @ West. Did the image loads and renamed foggyspritesheet. Then copied and pasted into the Document Folder. Jetz it works excellent. Going out with triple tab. Thank you.

  • Posts: 725

    Thanks all!

    @Elturro you need to tap the screen three times with 3 fingers to bring up the exit (and other) buttons. If you change display mode from FULLSCREEN_NO_BUTTONS to FULLSCREEN then the exit button will always be shown

  • Posts: 18

    Thanks again!

  • Posts: 725

    Updated to with weather,particles and bonuses. Now contains two tabs - a Particle one and the Main one. Not sure if I've uploaded to GitHub correctly as I'm new to it.

    https://gist.github.com/Westenburg/5761018

  • BriarfoxBriarfox Mod
    Posts: 1,542

    @West I must say I loved how you posted this with the image assets and suggestions to try an implement. I've been using it to learn more game mechanics. great update, I want to see how close i can get to it before peeking at your new code :)

  • Posts: 725

    @Briarfox - cool - I'm glad you're finding useful! Look forward to seeing your updates- the way I've done it isn't necessarily the best way so would be interested in other people's take on it.

  • Posts: 140

    @West, this is one of the coolest games I've seen--made with Codea. In my humble opinion, TLL should use it as a Codea sample program.

  • Posts: 725

    @Ric_Esrey - thanks for the kind words

  • Posts: 18

    Wow, the update is great. So i can learn more. :-B

  • Posts: 2,820

    Stunning... I love it. You did an unbelievable job incorporating real life photos into a game while keeping it pretty.
    One suggestion I have is to warn the player before a spider comes because if you're going fast, you're out of luck. One frame there's no spider, the next you're eaten.

  • Posts: 725

    @Elturro, @Zoyt - thanks!

    Yeah - the spider is pretty hidden against some of the backdrops - there is also a skull icon on the spritesheet that I had used originally which is a bit easier to see.

    I think the way that the horizontal speed is altered needs re-visiting - I think you speed up too fast too quickly when passing through the rings. The speed up bonus doesn't really do too much.

    Anyone made it into night time? - I was really happy with the way the stars appear, though the dusk transition could be smoother

  • Posts: 2,820

    I just barely did, then I got hit by a pesky spider. Urg. I suggest you add something like a red arrow pointing to the spider on the right side of the screen a second before it shows upl

  • Posts: 18

    Here is my unfinished design. It is interesting to play with your code. Please do not use the design Commercial.

    https://www.dropbox.com/s/fkoggeqeevo7y21/Foto 17.06.13 16 56 54.png

    https://www.dropbox.com/s/2mzap2zlla27qpf/Foto 17.06.13 16 57 10.jpg

    Bilder oder Fotos hochladen

  • Posts: 725

    Nice graphics - I like the consistency of your theme

  • Posts: 18

    Thanks West. It has to be adapted.

  • Posts: 437

    I'm using this for a game! :x

  • Posts: 725

    Nice - look forward to it

Sign In or Register to comment.