Game Development Reference
In-Depth Information
The pesky Goblin reacts with 3D particles
The player has made his or her move, and the Goblin has been affected in some way; it
would be nice to see what happened.
In this case, the player's sword (or axe, if you added the axe) has a damage level of 5 and
the player's strength is only 1 ; however, this will still give him a total attack damage of 6 .
The lazy Goblin didn't get any armor today while he was out pillaging in the woods with
his pals (unless he's alone and they ditched him), and his default health is of 1 . The for-
mula for this is as follows:
Health 1 - Attack Strength 6 = dead
So, the poor Goblin has to go and meet his maker in the worst way possible. This brings
us to one of the last troublesome issues with the new 2D system, that is, particles. To
make the death animation nice, we are going to add a particle effect when the Goblin is
killed along with some other animation.
Mixing up 2D and 3D
Now, as all of the 2D rendering in Unity is actually performed in 3D with some nice jazzy
helpers to make it look seamless, it is possible to add 3D objects to your 2D scenes. This
is possible, provided you still follow the normal pattern to balance the performance in
your scene; a large 2D scene that performs well is still going to have its performance
slaughtered if you throw lots of complex 3D models in the background. It is no different
than 3D in that respect.
However, what you do have to be content with is the drawing order (a good old z buffer
fighting for its return) of 3D elements in the scene as if they were 2D. The area that is
most impacted by this are particle effects .
Particle effects and 2D
Like other 3D elements, particle effects will work fine in a 2D scene, provided you set
them up correctly. To show this, we are going to define a new particle effect to use in our
Goblin's death scene. We will also add a new sprite to mark the Goblin's demise and leave
its mark on the world.
Search WWH ::




Custom Search