We have finished with the basic requirements for the lab.
Everyone should now have a working game.
At this point, we will each choose our path for the completion of the lab.
We have 3 paths to choose from. You may choose whatever you want, but for full credit, you must complete just 1 of the 3 tasks listed below:
- Programming
- Design
- Art
Programming
Our player has a sword, but we’re emulating a shooter game.
In a shooter, it’s crucial that the player can see whatever they are aiming at.
If a tree or something passes between the camera and the player, it will block your view.
Also, the camera’s angle must not change or it will screw up the player’s aiming.
Therefore, if the camera collides with something, we will push the camera forward to clear the obstruction.
- In the FollowCamera class, add a collision test to look for obstructions
- Use
Physics.SphereCast() - If there is a collision, push forward
- Reduce the
m_distanceCurrentonly without affectingm_azimuthorm_elevation - Do this immediately. Do not push forward gradually passing through the obstruction.
- Reduce the
- When the collision is over, gently ease the camera back into position
Design
Let’s set up some actual combat.
- Create something to use as a target dummy
- We need a graphic of some kind (anything will do)
- Put a collision or trigger on it
- Add some sort of collision-detecting mechanism on the player
- I recommend you do not attach the collision to the sword itself
- Instead, just model the spin-attack as a 360-degree cylindrical attack
- Activate the attack collisions only during the player’s attack animation
- Don’t forget to deactivate it afterwards
- If the player hits the target dummy with an attack, destroy the dummy
Art
This was supposed to be a shooter game.
Let’s change out our sword-guy for a shooter.
- Replace the character model with something more appropriate for a shooter game
- Some kind of projectile weapon
- Replace the animations:
- Standing idle, aiming forward
- Walk/Run forward, aiming forward
- Walk/Run backward, aiming forward
- Walk/Run right, aiming forward
- Walk/Run left, aiming forward
- Firing the weapon while aiming forward
- You may create your own character, or find one to download somewhere
Be sure to commit and push everything.
Fill in the conclusion report Conclusion Report