Tuesday 31 July 2012

Restartability...!

I've made a few changes, and the game's become super restartable and replayable!

I added the concept of a perfect run, where you get all the gems and don't collide with anything. Which then leaves the challenge of completing the level as quickly as possible. It's so addictive :) I had to keep going until I beat 10 seconds, (and I know there's a sub 9 second run int there...).




Spent half my time wrestling with timers in Unity. Then I found Time.realtimeSinceStartup, the timer I had been looking for all along, (as I'm scaling time with Time.timeScale, which makes Time.deltaTime somewhat smaller than I'd like...!).

Next up is a pause menu and a post-results menu. Then probably a bit of UI rejigging, as it is a bit cramped, especially on my phone!

Monday 30 July 2012

Results screens!

I had a tiny window to make some sort of progress today, so I went for an easy option: feedback on what's already implemented. I now have readable Dead, Out-Of-Bounds, and Results screens.

I went for a "straight-to-the-point" kind of style, as you can see from Figure 1...



Figure 1. You, well, you died.



It's done with a GUI box that fills the screen, and a GUI label in the middle.

Pretty happy with it!

The font is a Google web font called Asap.

The only annoyance is that if I want to use it at a smaller size I have to make a copy of the font and reimport it... I can live with that, and besides, I'd probably pick a different font for the more detailed information, such as timings and points breakdowns for the results screen.

Saturday 28 July 2012

Death, Timings and Out-Of-Bounds

A busy night!


I have finished implementing a nice little state system for the level. There's a placeholder pre-level state, the main game state and a results state.

The state system inspects a game monitor object, which is in turn notified of important events, such as when the helicopter touches a deadly red object. This is a nice way of stopping things messing with things they should know nothing about. The helicopter shouldn't know about the state system, as once it does, it could mess with it. All the helicopter can do is tell the game monitor that it's hit an object. No danger there!

I've also implemented a neat little out-of-bounds checker. I added an empty game object and added a collision box to it. I marked it as a trigger so that Mike wouldn't physically collide with it, and resized it to fit the whole level, plus a bit of padding. I then added this script to the object:


using UnityEngine;
using System.Collections;


public class OutOfBoundsScript : MonoBehaviour
{
GameObject m_heliGO = null;
GameMonitorScript m_gameMonitorScript;


void Start ()
{
m_heliGO = GameObject.Find("HeliCube");
    m_gameMonitorScript = GameObject.Find("GameMonitor").GetComponent("GameMonitorScript") as GameMonitorScript;
}

void OnTriggerExit( Collider other )
{
if( other.gameObject == m_heliGO )
{
// out of bounds!
m_gameMonitorScript.notifyOutOfBounds();
        }
    }
}



All it does is cache the helicopter and game monitor on start, then when the heli exits the trigger it notifies the game monitor. Simple!

The state machine then asks the game monitor whether out of bounds has been detected and it kills the game. Nice one!

Messy Intro

Welcome to the dev blog of Chopper Mike, a touch-based helicopter game for Android, (and maybe iOS).

I'm Jamie Lowes. I've been programming games for years and I recently started my own development company, (jamielowesdev.com).

I'm in the process of getting all my bits of Internet connected. Once it's all sorted, this will be the place to read small articles detailing the development process of my game.

You can also follow me on Twitter, (search for @jamielowesdev or #ChopperMike), where I'll be posting micro-updates, as you can't write all that much in 140 characters.

Videos will be posted to my youtube channel, (www.youtube.com/user/jamielowesdev).

So far, the game looks like this:



Right. Enough writing about it. Time to actually write it!