1. Download our Official Android App: Forums for Android!

Apps 2D monster truck game I made (open source). Any collaboration is appreciated.

Discussion in 'Android Development' started by sebnil, Jun 2, 2012.

  1. sebnil

    sebnil Lurker
    Thread Starter
    Jun 2, 2012

    Jun 2, 2012

    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. I rather see the game finished and not collecting dust in my private repository and that is why I decided to open source it.

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

    The game is similar to the MX Mayhem a monster truck instead of a bike.
    This video shows the latest code:
    Sketchy Truck. Andengine and box2d physics. Development video 3 - YouTube

    Library and technology used

    Working now
    • 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

    Spagetti code
    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.

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

    Source code and Copyright
    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 either the blog or the git repository.

    A todo:
    • Remove unused assets, pictures, sounds, etc..
    • Menus do not look good.
    • Add z-index of parallax backgrounds. Specify in xml with


Share This Page