Howdy, Stranger!

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

2D racer with track editor [update]

edited December 2011 in Code Sharing Posts: 11

This is a very basic top-down racer I wrote in Codea. It is far from finished, but I thought I would share it as is, as I do not have much time to work on it anyway :)

http://sourceforge.net/projects/codearacer/files/

Buttons on the left are acceleration/brake, buttons on the right are for steering.
Top-left gauge is speed, top-right shows how the tires degrade with time (which makes the turning radius larger).

There are two sliders in the "parameters" section. The one at the bottom (tracknr) is for track selection. I made 3 tracks, tracks 4-6 are empty. You can make your own tracks: select one of the empty tracks, then slide the top slider (edit) to 1.00. Now you can add obstacles by tapping the screen (you can move the just-placed element by sliding your finger, after you lift the finger it stays in place). Now the tricky part: after the track is finished, slide "edit" back to 0.00. Then select and copy the text in the "output" window (tap & hold, choose "Copy"). Go back to the editor, scroll to the very bottom and paste between the quotes (""). Now run the game and enjoy your track!

(The starting position of the car, and the start-finish line, are fixed.)

Tagged:

Comments

  • Works great. I like how the car slows down when you go through the barriers. Cool

  • Just had to register to say this is awesome!! I love what you guys can create with this app... amazing!

  • The editor/loading is interesting

  • SimeonSimeon Admin Mod
    Posts: 5,387

    That's a really clever way to do storage, @szleski. I've emailed Apple for the tenth time asking for information about the update, hopefully it will go through soon - that will include user side storage you can use to save tracks.

    Will try this out soon, sounds amazing.

  • Posts: 2,161

    I wonder if it's possible to find out from Apple which bits would go through easily and which bits would take time to approve. Then submit an update with the easy bits, and get that through quickly, then once that's approved submit an update with the hard bits and let it stew for a while while you work on what's going to be in the next update.

  • SimeonSimeon Admin Mod
    Posts: 5,387

    I suspect the only bit that would have trouble getting through is the export / import of Codea projects. As long as the code is "stuck" on the device Apple should be okay with it.

  • edited December 2011 Posts: 11

    http://szleski.posterous.com/racer-02

    Updated version of the racer:

    • custom sprites (prepared in Spritely),

    • race against AI cars,

    • switched to full screen mode (tap the button in upper right to quit),

    • just one track for now.

    I plan to upgrade track graphics and make a proper editor. Next I would like to play with different car physics models (skidding etc.) and AI algorithms, which was my original motivation for writing this.

  • The new cars look great.

    I follow the waypoint part but how to you did you get the AIs to make little cute mistakes?

  • Very cool! But none of the buttons seemed to render...only blank open squares.

  • Posts: 1,255

    Nifty! Darn those AI drivers. They keep speeding past me while I'm driving through the mud, slowly. Usually backwards.

    Very nice work.

  • I'm happy you like the update!

    @Ipda41001: I did not intend any mistakes in the algorithm (I checked this idea, but I think it is disabled now.) I guess the cars are not fully deterministic because DeltaTime can vary slightly (is that true?).

    @alvelda: The buttons are just empty squares, they light up when touched. I think of adding graphics (maybe arrows) or letters.

Sign In or Register to comment.