First Multi-Weekend Game

This weekend I started a bigger project than what can be encapsulated in a single weekend, so I fully expect to be posting about this for at least the next 2 weekends of work (if holidays allow, if not I will continue work at some point).

The mechanics I am going to share from this weekend are just the start, with a few more this will be a bit more of a complete game.

Mechanic #1 “Inventory”

For the game I have in mind you must have an ‘inventory’, it only needs to contain a single type of item but must contain many of them. For this I used an integer to represent the number remaining in the inventory and a GameObject object in the class to hold a prefab for instantiation each time the inventory object is ‘grabbed’.

So in short:

  1. Player hovers over inventory cube
  2. Player tries to grab
  3. This instantiates an instance of the prefab used
  4. Player is forced to grab the instantiated prefab

In the demo you might ask, where is the inventory cube? The answer to this is that it is actually a flat large cube behind the players head to give the impression they are grabbing it from their back.

Mechanic #2 “Goal Throw Point”

In this game you are going to be pulling objects out of an inventory and throwing them at goal points, think of basket ball for this mechanic. I needed a way to signify a point the player was supposed to throw an object, for this I used a sphere that was see through. For bonus points I added the ability for this sphere to be randomly spawned after being hit with the prefab from mechanic #1 in the area represented by a cube.

Mechanic #3 “Scoreboard”

In previous small projects for the scoreboard I would simply add a public variable for the UI.Text object in a script attached to whatever object I wanted to control the score. In this one I needed something new, something that allowed me to have multiple ‘reporters’ for score. For this I decided to use events, thus each of the goals have ‘scored’ events and the inventory has a ‘grabbed’ event. This allows us to show the user how many of the prefabs they have left and how many shots they have scored.

In the demo below you will see this on the handle bars of the bike the user is placed behind.

Demo

Some explanation is needed here… In the beginning I am trying to show the score board and object count on the handlebars of the bicycle. Once I grab the first cube from behind my head the bike starts moving forward and I have to throw the cubes at the orbs. Once struck the orbs move to new locations for a new challenge.

Anyway, that is where I end the weekend, and start the work week. Thank you for reading 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.