Bolerite

Programmer — Level Designer


  • Utilized Unity Events to create puzzle

  • Created Scriptable Objects for data retention between levels

  • Programed/Coded player movement and interaction

  • Created all game objects and programmed/coded their behavior using Unity’s primitive objects

  • Team: 2

  • Unity / C#

code Puzzle

implementation

The scripts utilizing Unity Events in Room One:

  • Key.cs

  • Keypad.cs

Execution

  • Key.cs — Each time a Key pressed, it sends it’s corresponding digit to the Keypad’s screen, displaying the string.

  • Keypad.cs — Once the correct sequence of numbers are entered, it sends a message to open a hidden door.

Challenge

  • Find the correct sequence of numbers to open the hidden door.

Code Snippet(s)

Keypad.cs — records key presses and invokes event

DoorControl.cs — Plays animation when unlocked

Switch Puzzle

implementation

BlastDoorButton.cs

  • Each Button has a reference to a “Blast Door” and the two Buttons across from it.

Execution

Once a Button is pressed:

  1. The Button will turn green.

  2. The two Buttons across from it will switch color.

  3. When a Button is green, their assigned Blast Door will open.

Challenge

  • Turn all Buttons green to open all Blast Doors.

    • Caveat: Only orange Buttons can be pressed.

Code Snippet(s)

BlastDoorButton.cs — Plays animation, turns Button color, and opens Door

Data Retention

scriptable objects

“Scriptable Objects” made this project possible for the following reasons:

Persistent Across Scenes

  • S.O.’s are saved as asset files, meaning they are a structural component of the project and not tied to a specific scene allowing them to be available when scenes change.

Data Management

  • They are able to hold data that needs to accessed or modified throughout different parts of the project i.e. collectables, game settings, player stats.

Decoupling from Scene Life Cycle

  • Game objects are destroyed and instantiated when a scene loads. For Reason #1, this allows a Developer to use any data they need without it being destroyed.

Performance Benefits

  • Helps optimize performance by reducing the need to repeatedly instantiate and destroy objects that hold data.

Implementation

ImageSO.cs

  • A list of Booleans.

  • Responsible for enabling the Keycard Image in the U.I.

InventorySO.cs

  • A list of strings.

  • Acts a pseudo-inventory for the player.

PostionSO.cs

  • A Vector3 dictionary.

  • Stores the Player’s position when entering a Puzzle Room.

execution

Every time a scene is loaded, S.O. data is initialized to their respective collections.

scenemaster.cs

  • The SceneMaster game object has a reference to the image component of each Keycard Sprite (U.I. Element) stored in a list.

  • Data from the Image S.O. is used to enable the image component.

  • When the Player enters a Puzzle Room, the Player’s position is recorded in the Position S.O. This allows the player to spawn from which they entered.

PlayerStats.cs

  • Loads data from the Inventory S.O. into the Player’s inventory list.

Code Snippet(s)