Chasing game with strong focus on AI solutions for games
Here is the key feature of this chasing game:
- The area has some surface surrounded by fences.
- There is a gaol on one side.
- There are two teams: purple and green.
- The players can only move on the game surface.
- The play time is limited.
- Purple players chase green players.
- A captured green player is taken to the gaol and remains there for the rest of the game.
- The purple team win if they capture all green players before the end of the game, otherwise the green team win.
The goal of the project
Spawn and set the players moving.
Purple players chase green players and catch them if they reach them.
Caught green players are escorted by the purple player to the gaol. When the green player has been deposited, the purple player starts chasing again.
Players cannot pass through the fence (without using Unity colliders).
Detect if either team has won.
The two teams have fully implemented state machines.
The players are initialised with individual values for maximum speed and turn speed.
The players move on the playground according to the repulsion-attraction model, including obstacles and boundary fences.
All assets are from Unity or downloaded from free assets.
- Player.Move(List, bool) should limit motion by maxSpeed and maxRotationSpeed (current stacking of vectors is improper, since it may lead to arbitrarily rapid movement).
- Player.isJailed does not just check if a player is in jail, but first moves the player.
- Declare two float constants instead of Player.ForceType.
- Have a variable of float, instead of the boolean rep to indicate whether to repel or attract.
- Player.RandomMove() is only called once, by Player.Start(). Some adjustments are needed.
- Use larger values for maxSpeed and currentSpeed, instead of multiplying those with numNormalizer.
- GreenPlayer.captured is not needed.
- GreenIdleState immediately transfers to either GreenRunningState or GreenEscortedState. Some adjustments are needed.
A build still needs to be created. Feel free to run the game from Unity.