My genius idea worked! I am now able to pick up an item, move to another location, drop it and move back to the original location without having the item magically respawn.
In order to do so, I had to re-write most of my code, but that's how the cookie crumbles.
The big change I made was to create the rooms during the declaration of variables. Before I was only using an instance of a room when moving. That meant that every time the player left the room, any changes made to the room would be erased and when the player re-entered, the room would look as good as new. (This is why if i took an item, left the room and returned, the item would re-appear.)
In making this change to the rooms, it borked my Moving code, so I had to fix all that. Then finally, i was able to write the Item code.
Phew. That was a good night's work.
-Dash27
No comments:
Post a Comment