Now we have a joystick input and feedback system we can start to flesh out the skeleton of the game engine.
The approach we are taking is for each player or enemy on the screen to be governed by states and rules. The rules are most likely to be quite simple like “canBeHit”. Currently this is the only rule, but that may change..
While the states will be things like “idle”, “walking”, “attacking”, “jumping” etc… In each state the rules can be turned on or off. This is how we limit what the player can and can’t do in certain states.
When they are in the “idle” state they will have access to functions like “BasicMoveset()” and they can be hit. While in contrast if they are in the “floored” state they won’t have access to any movement functions and they won’t receive hits.
The player and enemies will also have variables like “walkspeed”, “health”, “lives”, “gravity”, “jumpspeed”, “fallspeed” and then position calculation values like “xpos”, “ypos” and “xvector”, “yvector”.
Combo variables will control the timing and slickness of combo attacks. This is vital to creating a fluid fighting experience.
Each player will also hold an enemy queue, this will determine which enemy will attack which player and whether it’s from the front or back. The queue will be governed by variables like “distance to player”. If say the enemy is hit to the floor they will be removed from the queue for the time being, and another enemy will take their place in the queue.