470 Sprint 2
Work Completed
For this sprint, I continued work on the AI state machine. I added some features to the chase state and the attack state. These features dealt with the physical knockback the AI forced upon the ball and player. Some minor things added were attack stats to the AI which will determine how many health points each attack takes away. Another feature I worked on was the ball trajectory the ball would take to go inside the basket.
Attack and Health stats added to AI |
Essentially, the same concept was used for the AI to hit the player. The force was applied to the player's rigidbody and the same knockback effect happened when the AI was in the attack state and made contact with the player.
One of the more challenging tasks I worked on this week was the shot trajectory calculation. This was for the AI since we will need the AI to attempt to make shots when in range of the hoop. The first thing I started on was the shot path the ball would take. I was able to get the path working, and next I will need to work on the AI applying this force to the ball. Since this was a physics related issue, I looked up tutorials and Unity forums for trajectory code and equations. I was able to find some useful information and put something similar together in our project.
Here is some of the calculation code implemented. It utilizes kinematic equations to determine the force needed to get the ball from point a to point b. This works but may need to be altered to get more of a result we want for our game.
Comments
Post a Comment