When you create a game you are given one player to start with, but I need two players for my game since it’s going to be a Doctor patient type of game. So my question is how do I add a player to my game? I’m using the web version.
A player is just like any other object. On the 'Features' tab is an option "Player: player can become this object".
Then in whatever command or verb the player will use to change which character they're controlling, you just use the command:
or whatever the object's name is.
Note that a lot of people use the name
player, which is the name of the default player object, in their code. This can be a problem when you allow the player to switch. If there's some verb or command that the player can access as either character, you should use
game.pov in any code that needs to refer to the player object.
game.pov is the object that the player is currently controlling.
It may be worth knowing that there's two ways to change the player object. You can change it directly:
game.pov = john
and that will work fine. But the function:
may be easier in some situations, because it also displays the room description for John's location (in case the player had forgotten where he is)
After that you'd hand the computer over to someone else.