Simple Unity Game for Free

Last post we showed how we created a MOBA in 24h using Unity, giving the project’s sources for free in the end. The day before we got into that project, we’ve also coded another game for a fast workshop we gave at that time, a very simple maze shooter intended to show how easy one can create a fun and challenging game. We called it Spooky:

Spooky init screen. Can you escape the maze?

Spooky init screen. Can you escape the maze?

We’re also giving this one for free for beginner game developers and programmers who are interested in using Unity for their 3D games.

The game binaries can be downloaded (Win, Mac, Linux), and the project sources can be found on our Github page.

The game was made without the use of any 3D model besides Unity’s basic cubes and a single texture (for bullets). The cubes were coloured and scaled to represent the player (blue), walls (gray) and different enemy types (yellow, orange and red), each one increasingly more difficult to defeat.

Our inspiration came from a youtube video that showed how you can make a fun game using very simple graphics. We made it much simpler than the one in the video, so inexperienced programmers can still understand the code. You can always try to improve it and make it as complex and challenging as the one in the video.

Player, enemies and walls are basic cubes. The player can shoot the enemies (and some enemies do it as well).

Player, enemies and walls are basic cubes. The player can shoot the enemies (and some enemies do it as well).

The game consists of a single level/maze, that is populated by many enemies. The yellow enemies are almost harmless, except if the player touches them, going back to the beginning of the level. The orange and red ones also shoot the player, while the later one includes a screen-shield (meaning it has to be shot twice to be defeated). The enemies are positioned in the maze in order to give an increasingly difficult challenge level for the player.

The maze: besides finding the exit, the player has to defeat increasingly more challenging enemies.

The maze: besides finding the exit, the player has to defeat increasingly more challenging enemies.

The game uses only a handful of different object types, which we stored into prefabs. There’s the player, two bullet types (only the color changes), three enemies and a particle system (bullet explosion/sparks);

Prefabs were used to store the object types of the game.

Prefabs were used to store the object types of the game.

We only needed to write 5 very simple scripts:

  • player movement input;
  • player gun control and input;
  • enemy AI (shared for both enemy types that shoot – orange and red);
  • bullet script (that triggers sparks and object destruction on hit);
  • A test to check for victory condition;
Only 5 scripts had to be written.

Only 5 scripts had to be written.

Besides being just a handful, we made sure the scripts are also very simple to understand, nor having many lines of code, neither using any fancy/magic stuff.

The scripts are very simple to understand, specially tailored for beginner programmers.

The scripts are very simple to understand, specially tailored for beginner programmers.

So, what are you waiting for? Go to our Github page and download Spooky’s project sources and modify it at will. We hope you find it useful.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s