Game Development Reference
In-Depth Information
Chapter 8
Weaponry and Special Effects
With the garden currently being overrun by ravenous zombie bunnies, you will be thankful to get
some weapon-craft knowledge under your belt. Hand in hand with the rocket launchers, death
rays, and other weapons of mass—or even subtle—destruction are special effects. Mayhem and
destruction, as Hollywood can tell you, is just massively more entertaining with a liberal dose of
smoke, sparks, fireballs, the sound of exploding structure, and dying monsters. While your little
Garden Defender game is nowhere near to being a triple-A title, you will be learning the basics of
weaponry and special effects in this chapter to help with whatever your end goal may be.
Weaponry
No matter what your favorite game genre happens to be, there seems to be a strangely attractive
addiction to destroying things. Shooting them to make it happen is even more satisfying. It's
probably hardwired into us as part of the survival instinct. Regardless of its root, the functionality it
makes use of in game design is also useful for more passive scenarios.
Simple Projectiles
The mainstay of many weapon systems is the projectile. In Unity, it is generally brought to life and
controlled with physics. For this game, it seemed fitting that the garden gnome's bazooka be used
as a potato gun. For those of you who have had the opportunity to witness a real potato gun in
action, you will know that while they are loads of fun, potatoes are a bit lacking in pyrotechnics upon
collision. Fortunately, you will be taking some liberties with reality.
Let's get started by deactivating zombie bunny production while you build the weapon's functionality.
1.
Open the Garden 1 object.
2.
Select the Zombie Zone and Plant Zone, and deactivate them.
3.
Select the Zombie Spawn Manager, and deactivate it.
4.
Create a new C# Script in the Game Scripts folder, and name it PotatoLauncher .
339
 
Search WWH ::




Custom Search