SvenskaEnglish

2D Racing game in Android (help completing it is appreciated)

A while ago I started programming a game for android. Since I do not have time to finish it I thought it would be better to publish the results so far. Everything is open source and located on Github: https://github.com/sebnil/Sketchy-Truck

I rather see the game finished and not collecting dust in my private repository and that is why I decided to open source it.

Updates

[2012-06-03] Build path in the Eclipse IDE should now be working. Earlier this had to be configured before running the game.

Summary

The game is similar to the MX Mayhem a monster truck instead of a bike.
This video shows the latest code:

Library and technology used

- Andengine
- Box2d extension
- Physics editor http://www.physicseditor.de

Working now

- Andengine and box2d extension.
- Basic physics. The car is behaving quite good but improvements can be made.
- Inclination of the car with the mobile phone's accelerometer. Tilt your phone left and right will add a small rotating torque on the car.
- The world is created by editing XML files. I have created an XML structure to more easily create new worlds. This generator may need some improvements.

Spagetti code

You are free to make improvements to the code structure to. I would recommend a cleaning because this was my first medium-sized projects for android.

The separation between levels and the game engine

Right now you just add a new folder to add a new level to the game. In that adds XML and image files and thus will be able to create new tracks without touching the game engine. See world. xml for an example:
https://github.com/sebnil/Sketchy-Truck/blob/master/assets/levels/level1/world.xml

Examples of the folder structure of a level: https://github.com/sebnil/Sketchy-Truck/tree/master/assets/levels/level1
shape contains shapes from physicseditor. The World contains objects and background. GFX contains graphics. Quite simple.

Tested on

I have tested on HTC Desire, Google Galaxy Nexus and Samsung S2. Should work well on most modern devices.

Source and Copyright

Everything is on GitHub. Use the code in any way you think is best but please help make it better. If you make a change that is good then make sure to send it to the Github project. The goal of me posting this is to make the game better and closer to actuelly being on the market (for free). If you use the code to something else (such as a material in a tutorial 2d andengine) please leave a reference to this blog.

And thanks to the Emanuele Feronato for the example you wrote about using box2d to make a car with good physics.

A todo:

- Remove unused assets. fonts, pictures, sounds, etc..
- Menus do not look good.
- Add z-index of parallax backgrounds. Specify in xml with "zindex = #".
- Different speeds on parallax backgrounds. Set in xml.
- Engine sounds are awful.
- The shape of the car seems to be a little faulty. When one wheel with the car becomes the contact points are not ok.
- Remove load time when restarting.
- When clicking menu button the game should be paused and menu opened.
- When clicking back button ingame you should get back to the level select menu and not end the game..
- Add stopwatch and list best times. Highscore.