Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

VI. Unity & Gameplay Programming

Gameplay programming is currently my favorite part of game development. I focused a lot on maintaining high code quality in terms of readability and scalability, to minimize the technical debt when expanding the project even further later on. To achieve this, I wrote managers for handling game logics in different categories:

Game Master

  • Higher priority in script execution order
  • Update the current game state
  • Communicate with other managers and scripts to call functions according to game state
  • Holds commonly-used variables (e.g. player object, player position) for other scripts to access
  • Receives function calls from other scripts (e.g. start an activity)

Input Manager

  • Keeps tracking of the current input type (Mouse Keyboard / Gamepad)
  • Centralize the key and button mapping for player actions
  • Modify raw input values to become ready to use
  • Offers public functions for scripts to use if they need to detect player inputs

Sound Manager

  • Gathers all needed sound effects into a list for accessing them
  • Offers public functions for scripts to use if they need to play a sound

UI Manager

  • Gathers all needed UI elements for accessing them
  • Update the display of UI elements and values of UI texts
  • Update button prompts according to input type
  • Receives function calls from other scripts (e.g. fade screen to black)

Activity Script

  • Each activity has an activity script that handles the logics within that activity.
  • Keeps track of the current progress of the activity
  • Control activity objects and receives event signals from them

For simple objects such as the checkpoint arrow and flag, I use Blender to model them and export them to FBX using Blender To Unity FBX Exporter.

The shader graph I modified from this YouTube tutorial for making the transparent gradient effect for the checkpoint.

I make animations for UI elements within Unity Editor and use Animator to access them, Animator.Play() in script to play them.

Video link: YouTube / Google Drive

This video showcases the project view, the modifiable checkpoint system, and various manager scripts.

Support this post

Did you like this post? Tell us