Making monsters drop stuff when they die

Kingbry
Unregistered
 
Post: #1
Thanks to everyone that helped me make my staircases. I now have one last thing to do in order to soup up my code to the point where I am happy with it...

I need to make my monsters have an inventory, which they will drop when they die, for example they might be holding a key, or some hearts.

This is how I would like to be able to define such an inventory (in the plist for the map, which defines how all the objects are created). (The H string is the string that is the key for the Heart class's definition.)

Code:
        <key>M</key>
        <dict>
            <key>Class Name</key>
            <string>Monster</string>
                                     .
                                     :
            <key>Inventory</key>
            <array>
                <string>H</string>
            </array>
        </dict>

There is a function called didDieOnMap which seems like it would be the place to add the code for shedding one's inventory.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Newbie question about libraries and unix stuff... WhatMeWorry 8 3,950 Jun 25, 2005 04:17 PM
Last Post: OneSadCookie
  Moving stuff around derangedPEZ 5 3,731 Aug 17, 2002 04:54 AM
Last Post: derangedPEZ