4 ms·
You'll still have to modify that code to apply to containers, versus a a set/array that your language probably already supports
by Chris2048 4y ago
You'll still have to modify that code to apply to containers, versus a a set/array that your language probably already supports
- db48x 4y agoSure, your language has some kind of lists or arrays or whatever, and you could use one to store an inventory. But the UI designer decided that the player should be able to rearrange items in their inventory, so now you have to store a position for each one. And it has to have a background image, and such. But that’s what a room is! The room itself has a normal array of items and an array of positions, or something similar. Sure, rooms have a few extra features that containers don’t necessarily require, such as the ability to have exits. But that’s ok, the list of exits can be empty. No problem. Even if you enumerated all of those extra features you might not realize to document that nobody should ever put _actors that can move around on their own_ into a container.