P.S. The red with black car is AI and the red with blue car is player which controlled by me.
Once the player car triggered the sight distance of the AI, the AI will start chasing, in every loop, AI will calculate the heading direction to the player. Once the player is out of range, the AI will stop chasing.
For the collision detection part, I made sure that both car cannot move out of screen and collide with each other. The football served as obstacle where both car cannot pass through.
No comments:
Post a Comment