INSERT COIN

MY ROLE

Lead programmer. I built the game's code, tools, shaders and effects, and the way the pieces fit together. A few assets came from my team, listed below.

Systems I built

Game manager and scene management

The GameManager that runs each level's state (menu, tutorial, flying, game over, win), the shared LevelCore prefab and a LevelConfig asset per level, and the flow between scenes: Next Level, Restart, Continue and back to the title.

Menu-to-Level-1 flow

Moving the menu into Level 1 with an eased start transition, the optional tutorial popup, and handing the player from the menu into the tutorial or the level.

From the title menu into Level 1, with the tutorial skipped. Recorded from a copy of the game; a script made the menu choices.

End screens and final score

The game-over and win screens, the score count that plays out at the end, and a breakdown that adds up progress, asteroids, close calls, waves and overdrive.

The score breakdown counting up on the win screen, then name entry. Recorded from a copy of the game: a script flew Level 3 through waves arranged for the capture and then triggered the win, so this is not a score a player earned.

Playtest and debugging tools

The Tuning Overlay, a live window for changing movement values during play and saving them, which later became the player-facing Steering Settings and pause menu. A diagnostics overlay for frame rate and quality levels, and a Test This Pattern button for trying one pattern on its own.

Player and camera

Orbit movement, boost, dash, dodge, minimum speed per level, death sequence.

Orbit movement and a side boost in Level 3. Recorded from a copy of the game and flown by a script.

Hamster modelling, rigging and animation

I modelled and rigged the hamster, and animated it: Idle, Scurry, Hit and a menu Float animation, blended into the run when a level starts.

Spawning and level design tools

ObjectSpawner, wave phases, and a Pattern Builder editor window with fairness warnings and a wave preview.

The Pattern Builder in the Inspector: presets, wave shapes and their settings.
The Pattern Builder in the Inspector: presets, wave shapes and their settings.

Asteroid and pickup behaviours

Spiral, Homing, Splitter, Growing, Magnet, Frost, phasing; ten power-ups including Twin, Bomb, Lance, Warp and the Mystery pickup.

Score and run flow

Combos, close calls, multiplier, overdrive tally, tutorial, leaderboard, Continue.

The local top-10 leaderboard on 10 November.
The local top-10 leaderboard on 10 November.
A Lance combo, a close call and wave bonuses in Level 3. Recorded from a copy of the game with waves and pickups arranged for the capture, flown by a script.

Shaders, VFX and performance

Volumetric skybox, shield and rainbow shaders, Black Hole, post-processing and CRT look, palettes, pooling and quality levels.

Building the Black Hole shader, 24 October: debug views show one part at a time (radius, arch, disk, ring, light), then the finished material.
Building the Black Hole shader, 24 October: debug views show one part at a time (radius, arch, disk, ring, light), then the finished material.

Code samples

Orbit movement (PlayerMovement.cs)

The game's core mechanic. The distance moved along the circle, divided by its radius, gives the change in angle; cosine and sine turn that angle back into a position, and the hamster is rotated to face the centre. The boost fades at the same rate at any frame rate.

private void Movement()
{
    // Distance travelled along the circle this frame; positive = counter-clockwise
    // The mouse delta is already distance per frame, so it isn't scaled by time; the boost is a speed, so it is.
    // Distance divided by radius = angle in radians, so we can add it to the orbitAngle directly.
    float arc = ((moveInput.x * mouseSensitivity * SensitivityScale) + (boostVelocity * Time.deltaTime)) * (1f - frostOrbitSlow);
    orbitAngle += arc / CircleRadius + pullRate * Time.deltaTime;
    pullRate = 0f;
    frostSpeedSlow = 0f;
    frostOrbitSlow = 0f;
    PlaceOnOrbit();

    // Boost fades out over time instead of cutting off instantly. 1 - e^(-k·dt) fades the same at any frame rate.
    boostVelocity = Mathf.Lerp(boostVelocity, 0f, 1f - Mathf.Exp(-boostDecay * Time.deltaTime));
}

private void PlaceOnOrbit()
{
    // Offset is defined by the cosine (left/right) and sine (up/down) of the angle, multiplied by the radius to get world units
    Vector2 offset = new Vector2(Mathf.Cos(orbitAngle), Mathf.Sin(orbitAngle)) * CircleRadius;
    Vector2 center = OrbitCenter;
    transform.position = new Vector3(center.x + offset.x, center.y + offset.y, transform.position.z);

    if (faceCenter)
        transform.rotation = Quaternion.Euler(0f, 0f, orbitAngle * Mathf.Rad2Deg + 90f);
}

The Mystery roll (PowerUp.cs)

Picks the pickup's effect when it is collected, weighted by adjustable chances. Results that would do nothing right now get a weight of 0, unless every result would.

private PowerUpType RollType()
{
    float total = FillWeights(true);
    if (total <= 0f) total = FillWeights(false); // everything is wasted: roll from the plain chances instead

    float roll = Random.Range(0f, total);
    int last = 0;
    for (int i = 0; i < RollTypes.Length; i++)
    {
        if (rollWeights[i] <= 0f) continue;
        if (roll < rollWeights[i]) return RollTypes[i];
        roll -= rollWeights[i];
        last = i;
    }
    return RollTypes[last]; // the roll landed exactly on the total
}

// Fills rollWeights from the template's chances, with wasted types at 0 if skipWasted. Returns the total.
private float FillWeights(bool skipWasted)
{
    float total = 0f;
    for (int i = 0; i < RollTypes.Length; i++)
    {
        bool wasted = skipWasted && IsWasted(RollTypes[i]);
        rollWeights[i] = wasted ? 0f : Mathf.Max(0f, ChanceOf(RollTypes[i]));
        total += rollWeights[i];
    }
    return total;
}

Effect pooling (EffectPool.cs)

Plays a particle effect by reusing a finished copy, and only creates a new one when none is free.

// Plays an effect at a position, reusing a free copy if there is one.
// With no pool in the scene, it falls back to a plain Instantiate.
public static void Play(ParticleSystem prefab, Vector3 position)
{
    if (prefab == null) return;
    if (instance == null)
    {
        Instantiate(prefab, position, Quaternion.identity);
        return;
    }

    Stack<PooledEffect> free = instance.GetFreeList(prefab);
    PooledEffect effect = free.Count > 0 ? free.Pop() : instance.CreateEffect(prefab);
    effect.transform.SetPositionAndRotation(position, Quaternion.identity);
    effect.gameObject.SetActive(true);
    effect.Particles.Play(true);
}

The full code is in the game's repository on GitHub.

The team