Rookie Awards 2024 - Open for Entries!
Stack
Share

Stack

by Archie3233 on 11 May 2022

Arcade

0 649 0
Round of applause for our sponsors

Stack

This project is my own remake of "Stack" created by Ketchapp. The goal of this project was to provide an addictive experience by creating gameplay that is simple, but satisfying to the player.

Game Features

Block Float

For the majority of runtime, Stack awaits the player input to place a new block on the tower. I have used co-routines to allow this to happen frame-independently.

The "BlockFloat" co-routine continuously lerps a floating block from side to side while the player isn't giving an input. Once the player inputs to place the floating block, the co-routine is ended.

Block Placement & Cutting

Block Placement

Within the Game Manager class, Stack tracks whether a new block can be placed using a boolean value. If "bCanPlaceBlock" is equal to true at any point, the "NewBlock" co-routine is fired to instantiate a new floating block.

The vector to instantiate the new block is variable due to potential previous block cuts throwing off the alignment. To keep track of the tower centre, I have used a static Vector3 so when a new block instance is created, it will use the same copy of the Vector rather than a new one with default values.

Cutting a block

If the player places a block outside of the range of a perfect stack, the placed block is cut making it more difficult to place future blocks. 

To cut a block I've written a function which calculates how far off the tower centre the placed block is, then shrinks the size of the placed block by this difference. A new "Cut Off" block  is instantiated with the width taken off the placed block. This new "Cut Off" block falls giving the illusion that the placed block has been split into two pieces.

CutBlock spawn position = PlacedBlock position + offset from the tower origin (x or z axis).

CutBlock size = PlacedBlock size - the offset from the tower origin (x or z axis).

Player Leeway

Occasionally, stack will subtly help the player to ensure the game feels good to play. 

A "Perfect Stack" is performed if the player manages to perfectly place a block on top of another. If the player is close to a perfect stack, the game will snap the block perfectly on top of the tower and it will appear as though the block was placed perfectly. This leeway creates a perfect stack range determined by a variable exposed to the editor.

Environment System

I implemented an environment system to add more variety to the gameplay. Once the player reaches 10 consecutive perfect stacks, the background lerps to a dark colour and a storm appears. The theme lerps back to default once the player misses a perfect stack.

To implement this feature, I created an environment controller component attached to a game object acting as the controller. The component controls when to enable the lightning light effects, and when to play the lightning audio clips.

Full C# Classes

Other

Resources Used

Game of Squids font

LightningStrike Sound FX

Software Used

Unity 5, Rider

Time Estimate

1 month


Comments (0)

This project doesn't have any comments yet.