Portfolio

illustrations illustrations illustrations illustrations illustrations illustrations illustrations

Mobile 2D car game (First coding project 2014)

Published on Jan 01, 2014 by debnera on game

Mobile 2D car game (First coding project 2014)

Mobile 2D car game 2014

Theme: Prove that I can make a game similar to a very popular Android game (+ learn to code)
Project duration: several months or years of on-off coding
Team size: 1
My task: Everything (solo project)

An unfinished C# / Unity mobile game which is heavily inspired by the popular ‘Hill Climb Racing’ game. Basically the first game I worked on after finishing a couple of Unity tutorials.

Playable demo

Introduction

This is a mobile game, which I started creating in 2014 during my free time after completing the first programming courses of my bachelor’s degree. In practice, this is my first game that was not based on Unity tutorials.

This game is unfinished, because I had planned way too many features for this game and I greatly underestimated the amount of time required. The code was refactored way too many times to fit another ‘cool feature’, such as destructible terrain. Destructible terrain actually is already implemented, only needing a tank which could shoot explosive projectiles. (A prototype tank is actually in the game, but it won’t shoot anything). I also spent a lot of time creating a neat set of development tools, which no-one will ever see. Tools include a semi-automated vehicle-creator for adding/modifying the suspension and adding n-amount of wheels. I would have saved a lot of time by just manually creating levels and vehicles.

Everything you see is coded by me, unless it already existed in the Unity 4 engine. I drew the cars by myself, but otherwise I mainly used the free assets for graphics.

As the Unity 5 has a new HTML5 WebGL-based player, I thought it would be easy to include this game here. It is amazing to see that we are finally able to replace all those clumsy plugins with plain HTML and JS.

I wanted to release this project in its current unfinished state, because I feel that this project has a lot of elements worth showing. It is the only C# project I have made. I also learned a lot of C# doing it, as I consumed every C# programming concept tutorial I could find on the Unity tutorials.

How to play

The goal of the game is to get to the finish line.

While the game was designed to be touch-controlled, it can also be controlled with a keyboard.

  • Gas - Right-arrow / D
  • Reverse - Left-arrow / A
  • Brake - Down-arrow / S
  • Menu - Space

From the menu you can change your vehicle, upgrade your vehicle and change the level.

All of the levels are finishable, except for the infinite level.

Bugs

  • Apparently only highscores persist on this WebGL version. Money seems to disappear. I might look into this issue in the future.

Current state of the game

Planned and partly implemented features:

  • Destructive terrain
  • Randomly generated terrain
  • Skill-levels for challenge
  • Infinite-levels for getting the highest score
  • Mission-levels for fun
  • Lots of different upgrades (four for every vehicle)
  • A neat set of 2d-game tools to be publicly released in the Unity asset store

The minimum required steps to finish this game:

  • More vehicles
  • More levels (Maybe procedurally generated…?)
  • Fine-tuning car physics
  • Fine-tuning the cost and effect of upgrades
  • Simple sounds
  • Publish to Google Play Store

Highlights

Curvy terrain

The terrain is made with bezier curves. More specifically a single ground- object is a set of four coordinates which is converted into bezier curves and further in to the vertices of a mesh-component. Finally the collision- component is added along with the materials for the ground and the grass. All terrain-objects are stored as a set of coordinates and the mesh is dynamically created when the player gets close enough.

It would be possible to completely generate the terrain during run-time, and that also seems like a viable idea if I ever want to finish this game.

Destructible items

As you can see, there are explosives and breakable obstacles. Broken objects create debree, which will vanish in a few seconds. This is not something that was already included in Unity 4, unlike it is in Unreal Engine.

What I learned

  • Lots of C#
  • Even a seemingly simple game requires an enormous amount of work
  • I cannot plan to implement everything that comes in to my mind
  • I have to set a timeframe and carefully select a few core ideas which I can realistically complete in that timeframe

Similar Stories