I wanted to experiment with ways of forcing players to move round levels in a turn-based tactics game, rather than remaining static and waiting for enemies to come to them. In Left Behind, players must manage health, oxygen, energy and ammo whilst working towards the goal of escaping from the planet.
Left Behind Game Architecture
Left behind is a turn based game. For this, I tried following an observer programming pattern. The GameManager triggers turn-based 'events' which subsequent Manager classes subscribe to. The Managers change the state (and thus behaviour) of the associated agents that they control. I had only only ever coded using update loops before and I found great success in switching to this event based system.
PlayerGroundedState
The agents follow a state pattern. I did this so the interaction between specific agent behaviour types (Idle, OutOfEnergy) was much clearer. This meant code implementation could easily be copied from gameplay flowcharts and diagrams.
State Factory
Another new programming pattern I tried was the Factory Pattern. I used this so I could easily code different agent types. Different types of enemies could use the same state machine, but use different factories, and therefore have acess to different states.
Prototype Cable
The grey line shows an early version of the cable. The player must attach cables from inside the shaded floor area. When attached to a player agent, the cable behaves like an extendable hose. It will get caught on obstacles, and will retract and free itself if the player agent moves back along its path.