Game Development Reference
In-Depth Information
a life is lost other than decreasing an internal counter that has no effect. Therefore, the next
step is going to create a generation and destruction mechanism for player's character (the
cube). Remember that we have already counted for this, hence created a cube prefab with
all necessary scripts attached to it. What we need to do now is to remove the cube from the
scene and delegate generation and destruction functions to PlayerSpawn script. This script
controls when to destroy an existing player cube and instantiate a new one. Listing 79
shows this script.
Search WWH ::




Custom Search