Racing game - Atari Enduro

http://www.youtube.com/watch?v=cwByOZEey1Q

Source code: https://gist.github.com/1340980
(all combined in one file)

The controls take some getting used to

That’s amazing ruilov. I love the way you’ve done the night-time track and clouds.

How did you do the curving track? Lots of line segments?

Really impressive.

Just tried this - the way you drew the cars is so good.

Thanks. I tried to keep as close to the original game as possible (which sells for 99c on the app store btw! It looks like they don’t even have the copyright for it)

Tracks with ellipse() with a really big radius.

The original actually had mountains at the horizon instead of clouds, but I couldn’t do the mountains and the tracks at the same time using ellipse() - having a function to draw ellipse arcs would help, maybe in the future? :slight_smile: So in the end I stole the clouds from the Lua Jump example.

Any comments on the controls by the way? Did you manage to use it ok? I was trying to detect a jerk forwards/backwards with UserAcceleration, but didn’t manage

I thought the controls felt good – though the game was pretty tough! ellipse() for the track, I never would have thought of that. I’m seeing your YouTube video pop up a fair bit on twitter too :slight_smile:

Arcs are very possible, we’ll just need to write the shaders to handle them. Arbitrary polygons might come first, though.

I haven’t actually tested UserAcceleration very much. UserAcceleration is straight from Apple’s device motion APIs (as is Gravity). On iPad 1, I manually low-pass filter the accelerometer values to get gravity, and high-pass filter them for user acceleration. On iPad 2 they are available pre-filtered. Gravity is normalised to screen orientation while UserAcceleration is left in global coordinates.

tried on some friends and no one could make much progress, so…reduced the threshold for crashes and decreased the max speed to about the optimal speed (~170) so that you don’t have to worry about speed (unless you’re in the snow or fog)

I can get to level 4 now

Posting a screenshot here

Enduro

Added to wiki https://bitbucket.org/TwoLivesLeft/codea/wiki/UserContrib

Best thing about all the things moving to wiki today was that it brought the game back to the top. I missed it first time around, but this is terrific.

Nice work, ruilov!