My Code
Game loop:
There are two special scenes. PersistentObjectsLoadScene
is loaded at the startup, then there is the
MainMenu
scene.
The main menu is an isolated part of the code, which is managed by MainMenuManager
.
It displays available levels which are defined as LevelParameters
ScriptableObjects.
The gameplay is much more complicated.
Each level is a separate scene like Level_1
.
When a level is started, first of all a persistent manager called LevelPersistence
is requested to load the level, which replaces the initial level state with the loaded state.
For ui there is GameplayUIManager
which provides an abstraction over the gameplay UI.
If the player is on android TouchControls
is initiated to make on-screen controls work.
Additional manager clasess are ViewmodelManager
which enables gun view model display, PauseMenuManager
which allow pause menu logic.
The player prefab is divided into many classes and components:
PlayerController
- main componentMovementComponent
- movementPlayerSaveComponent
- saving the player stateUseComponent
- use key mechanicsWeaponSystemComponent
- general weapon handlingRevolverComponent
- revolver mechanicsRevolverInventorySystem
- the inventory system behaviour, which informs UI of what should be displayed
The enemy prefab is divided into a main component EnemyBotController
and a visual component BotDisplayComponent
. The AI is represented by a state machine, where each state is an instance implementing IState
.
Key MonoBehaviours:
PlayerController.cs
- the core player component, quite short despite being the main oneRevolverComponent.cs
- the component, which implements the revolver logicEnemyBotController.cs
- main enemy AI component, run’s the enemy state machine
The class I am proudest of is LevelPersistence.cs
, because it is the top of the save load system but is so simple nonetheless.
MainMenuManager.cs
would be the class to receive the complete overhaul, it’s just a bunch of hardcoded ugly stuff to make the main menu work.
Files
Get Rootin' Tooter
Rootin' Tooter
A somewhat buggy shooter
Status | Released |
Author | KCKy |
Genre | Action |
Tags | cuni-mff-ncgd008-24-25 |
More posts
- About developmentFeb 16, 2025
- RequirementsFeb 16, 2025
- PrototypeFeb 11, 2025
- DesignNov 09, 2024
- Design (old)Oct 13, 2024