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.
[2012-06-03] Build path in the Eclipse IDE should now be working. Earlier this had to be configured before running the game.
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
- Box2d extension
- Physics editor http://www.physicseditor.de
- Andengine and box2d extension.
- Basic physics. Car behaves quite good but improvements can be made.
- Tilting of mobile accelerometer. Tilting to the left and right will add a small rotating torque on the car..
- Worlds are created from editing xml files. I have created a xml structure to more easily generate new worlds. The world generation will ofcourse need improvements.
You are free to make improvements in code structure if you want. I would recommend some cleanup since this is one of my first android projects.
The separation between levels and the game engine
Right now you just add a new folder to add a new level to the game. Therein is the XML and image files and this makes it possible to create new tracks without touching the engine. See world.xml for an example:
Examples of the folder structure of a level: https://github.com/sebnil/Sketchy-Truck/tree/master/assets/levels/level1
shapes.xml contains shapes from physicseditor. world.xml contains objects and background. Gfx contains graphics. Quite simple.
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 Emanuele Feronato for publishing an example of how to use box2d to make a car with physics..
- Remove unused assets. , pictures, sounds, etc..
- Menus do not look good.
- Add z-index of parallax backgrounds. Specify in xml with “zindex = #”.
- Different speeds of parallax backgrounds. .
- Engine sounds are awful.
- The shape of the car seems a little wrong. When you roll with the car the contact points do not look 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 a stopwatch and highscores.