The Anatomy of a Game: Objects
February 28, 2022•210 words
If all you could do in a game is wander around the landscape, it’d quickly become a tedious experience. Objects are one of the things you can interact with in a game.
Objects can be in a location. When you go to that location you can see the object. Sometimes a game will require something to happen before the object can be seen. Perhaps a chest must be unlocked or a secret panel opened before the object is revealed.
Objects can be carried. You can take an object using the take command, and you can drop it using the drop command. You can check which items you’re carrying—or wearing, if the object is clothing—by using the carrying command.
Objects are usually used to solve problems. Perhaps you find a head torch. Elsewhere you find some batteries. You need to perform some sort of activity in a dark location. Before you can do that, you need to put the batteries in the head torch, and turn it on.
Problems can define their own commands, so the command to fit the batteries might be fit the batteries, or insert batteries or whatever the game author chooses.
As you can see, you’re not limited to take
and drop
when you’re interacting with objects.