Continuing the discussion from IF system code *wars:
Challenge: Create a game with a rope that can be dragged around and tied to an object.
Requirements (mostly created by @warrigal) :
Setup: (note that for parsers, things like Portable and Tieable need not use a built-in library model).
- Create three locations.
- Create an object that is Portable (ie can be moved by the player) and Tieable (ie can have a rope tied to them). Ex: A suitcase, a bag, a bottle.
- Create a rope.
Implementation
- The rope length shall be able to span two locations at a time.
- The entire rope shall be able to be carried and dropped.
- The rope shall have two ends, which can be carried and dropped separately.
- Dragging:
- If the 1st end of the rope is carried, and the player moves to an adjacent, the 2nd end of the rope shall be left behind in the location they just left.
- This shall apply if they move two locations–the 2nd of the rope will drag behind them into the adjacent location they just left.
- If the player returns to the previous location, they shall see the 2nd end of the rope.
- Picking up the entire rope shall pick up the 2nd end from the other room.
- If the 1st end of the rope is carried, and the player moves to an adjacent, the 2nd end of the rope shall be left behind in the location they just left.
- Tying:
- The rope shall be able to be tied to an object. (parser commands: TIE OBJECT to ROPE // TIE ROPE to OBJECT)
- This shall work whether holding a single end or holding the entire rope.
- If holding the entire rope, any end shall be tied and the other end shall stay free. If holding a single end, the held end (1) shall be tied and the other end (2) shall stay free.
- The player can carry the tied object and/or the 2nd end of the rope and drop either.
- If the tied object is picked up or dropped, the 1st end of the rope is picked up or dropped as well.
- Vice versa for the 1st end of the rope.
- If the player moves while holding the object and not the 2nd end of the rope, it shall follow the aforementioned dragging behavior.
- Vice versa for if the 2nd end of the rope is carried and not the object.
- An object shall be able to be untied.
- The rope shall be able to be tied to an object. (parser commands: TIE OBJECT to ROPE // TIE ROPE to OBJECT)
- I labeled one end 1 and the other end 2, but these behaviors should work for both ends.
Suggested Test:
- Start in location 1 with the rope and object in it.
- Pick up the object.
- Pick up end 1 of the rope.
- Move to location 2.
- Move to location 3.
- Return to location 2 and see end 2 of the rope.
- Move to location 3.
- Tie end 1 to the object.
- Drop end 1.
- Move to location 2.
- Pick up end 2 of the rope.
- Move to location 1.
- Return to location 2 and see end 1 of the rope and the object attached to it.
- Untie the object from the rope.
Bonus requirements:
- Parsers: Implicit actions such as TIE OBJECT and TIE ROPE will work as TIE ROPE TO OBJECT // TIE OBJECT TO ROPE)
- Add an object that is Tieable but not Portable. Ex: an anchor, a mailbox.
- The player shall be able to hold the other end of the rope or drop it.
- While holding the rope:
- The player shall be able to return to the original location.
- The player shall be able to move to an adjacent location.
- The player shall not be able to move to a further location.
- Add another Tieable and Portable object.
- The 2nd end of the rope may be tied to other objects.
- The 2nd end of the rope may be tied to other objects in adjacent rooms.
- Picking up the entire rope will pick up both objects and ends.
Open to feedback!