Final basic mechanics - End of SPRINT 1
- zm02stor
- Sep 12, 2022
- 2 min read
[6 - 10/9]
The last few mechanics to implement were the bait throwing mechanic, enemy (owner) following player, points when cats are placed in the drop off point and respawning when the enemy catches you.
The bait is thrown when the player holds onto the mouse button. The longer the player holds onto the button, the further the bait is thrown. The throwing force is limited in order to prevent the player from throwing the bait out of bounds or too far. When the player let's go of the mouse button, the bait is instantiated and appropriate velocity is applied in order to throw it in the direction the player is facing (using forward position of the camera)
[screenshot of thrown bait]
A NavMesh agent is used for the enemy (temporarily) and the player's current position is set as it's destination. When the player collides with the enemy, their position is reset to (0,0,0) for them to respawn.
Changes were also made to the cat's movement script and behavior. If the cat is within a certain range of the bait, they will stop wandering and change course towards the bait. If distance between them and the bait is greater than a certain amount, they will continue to wander. When the cat collides with the trigger component of the bait, the bait will be destroyed. A problem has occurred with this where if a cat has eaten the bait, they will stay in position hopping until another bait has been detected.
A goal has been made for the player to drop the cat's off in. It has been elevated so cat's do not accidentally wander inside. When the player picks up a cat and drops them off here, the cats collected will increase and the cat will be destroyed. A simple UI has been made to display this value to the screen.
Now that all the base mechanics have been implemented in their simplest form sprint 1 has been completed.


Comments