|
|
|
|
 |
| Create an array of missile objects that you can fire from your missile launcher by using your Xbox 360 controller or keyboard. |
|
 |
Step 1 |
|
|
|
| Add new variables to your GameObject class to allow for objects that have velocity and that can toggle between alive and dead modes. |
|
|
|
|
|
Step 2 |
|
|
|
| Create and initialize an array of new missile GameObjects that can be fired by the player. |
|
|
|
|
|
Step 3 |
|
|
|
| Modify Update to call FireMissile when the player presses the appropriate button, but use previous input states to keep them from holding the button down. |
|
|
|
|
|
Step 4 |
|
|
|
| Learn about transformations and vectors in 3D while creating the FireMissile method that places missiles at the appropriate position and velocity when fired. |
|
|
|
|
|
Step 5 |
|
|
|
| Create an UpdateMissiles method that applies velocity to flying missiles and eliminates them from the game world when they fly too far away. |
|
|
|
|
|
Step 6 |
|
|
|
| Draw your missiles, using the DrawGameObject method in a loop. |
|
|
|
|
|
|
|