December 2004
Beginner
432 pages
10h 17m
English
You need to finish up just a few things in the player class before you're ready to begin using it. One of those things is to add the code that fires the bullets! You couldn't do it up to this point because the classes weren't defined, but now that you've implemented the bullet classes, this is the perfect time. What you want to do first is add a method to fire the round (Listing 15.8) to the player class.
/// <summary> /// Will add a new bullet to the list /// </summary> public void FireRound(Device device, Bullets list) { // Get the bullet start and velocity Vector3 bulletStart; Vector3 bulletVel; GetBulletStartLocation(out bulletStart, out bulletVel); // Finally add the new bullet list.Add(new ... |
Read now
Unlock full access