O'Reilly logo

3D Game Programming for Teens, Second Edition by Eric Grebler, Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Bullets

Creating a bullet itself is really quite simple. You can use an image from a 3D modeling program, but in most cases, spheres or cylinders work just fine. You can fancy up your bullet by applying a bright texture or giving it a color. One idea would be to have the bullet flash by randomly changing its color as it flies. Regardless of how you create your bullet, the tricky part is to make it fly, create multiple bullets, and have them go in the right direction. That’s what I’ll be covering in this section. The method I describe here is not the only way to create and fire bullets, but it’s one of the easiest. We’ll explore different options for bullets, including setting a maximum number of bullets, reloading, and changing the direction ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required