Game Development Reference
In-Depth Information
This is a simple script we have to attach to the ball, in order to make it able to collect
money (coins). This script can be extended to include whatever inventory you may think
of. However, for our case we need only one variable, which is money . The importance of
this script is the ability to gives to the collector. If there is a collector who does not have an
inventory box, its collision with coins is going to be ignored, since coins require inventory
box to be collected into. This can be useful, for example, if you want to have NPCs that can
collect many things (weapons, power-ups), but not coins. Now we move back to our coin
and add to it the script Coin , which specifies the behavior of a coin. This script is shown in
Listing 30.
Search WWH ::




Custom Search