Skip to content

Interactions

David O'Rourke edited this page Jun 15, 2022 · 1 revision

Basic bitsy interactions

Bitsy 7.12

Basic Interactions

Play a working demonstration here

Apart from bumping into walls, there are 5 basic interactions in bitsy.

  • The title sequence
  • Pickup up items
  • Interacting with sprites
  • Exits
  • Endings

Each of these interactions can have a dialog associated with it. See the other pages on dialogs for more information.

The title sequence

The title sequence runs when you first start the game. Any text in the dialog is displayed against a plain background, before you enter the first room.

Items

Items are picked up automatically if you move over them. And any associated dialog is then triggered. All the items of a particular type share the same dialog. If you use dialog features such as shuffled or sequential lists, then it means that items of the same type can give different interactions each time you pick them up. For example you might tell a player that they have picked up a key, the first time they do so. But then not bother to say anything when they pick up further keys.

If you design your item to look like the background tile, then the item will be invisible. You can use this for genuinely invisible items like secrets, or to show text when a player moves close to something, but without any visual cue. Because items are always collected when you move over them, you can only interact with a specific item once per game.

By combining the images for the item and background tile you can make things appear to change, or just make things appear from nowhere. You could for example leave footsteps behind the player by having footsteps on the background, and covering them with blank items that have no dialog.

example 1 - multiple instances of the same item

This is the demo item dialog for the spinning lozenge. It contains a sequence. The first lozenge that is collected uses the first text, and subsequent lozenges use successive pieces of text from the sequence. When the sequence is complete, the last text is re-used. In this example the second (last) text is blank, so no dialog is displayed for any lozenges after the first.

{sequence
  - Items disappear when you move over them. 
    You pick them up and they are in your inventory.{pg}The next item you pick up will not have any dialog.
  - 
}

example 2 - exit from an item dialog

This is the demo item dialog for the potion. Drinking the potion will transport you to somewhere else in the same room.

Picking up an item can transport you to another room, or another place in the same room{pg}{exit "0" 1 1}

Sprites

Sprites are often non-player characters. There can only be one instance of each sprite anywhere in the game. You can't move the player onto a square with a sprite, so you interact with them by pushing against them. The same dialog runs each time you interact with the sprite, so you can use complex dialog with branches or sequences to change things up.

As with items, you can design sprites so that they are not visible against the background.

example 3 - exit from a sprite dialog

Talking to the dog will also transport you to another place

Complex interactions with sprites, could include exits or endings{pg}I'll move you to another place with an exit{pg}{exit "0" 14 2}By the way, there's an invisible sprite in the corner. See if you can find it.

Exits

Exits transport the player from one place to another either in the same room or a different room. Exits can be two-way, where the stepping back on the destination will take you back where you came from; or one-way. Each direction of an exit has an associated dialog.

Exits can also be locked. This is done within the dialog, often with some sort of value expression. A locked exit will not operate to transport the player. You might decide to lock an exit unless a player is carrying a certain item in their inventory.

Exits have option transition styles. Some of these demonstrated in the working example.

Exits are in themselves invisible, they have to designs in the paint box. So it's common to indicate their presence in some way, you might put a gap in a boundary wall to suggest an exit to another room, or you might colour the floor differently to suggest a portal of some sort. But there are occasions when you might genuinely want the exit to be a surprise.

The dialog system itself includes the ability to transport the player in the same way as an exit. This means that you can have a item that you pick up which transports you to another place, or have a player character transport you. it's very common in bitsy to acheive effects such as making things appear or disappear, by using nearly identical rooms, and transporting the player from one to the other by using dialog exits.

A locked exit can be a useful way to run a dialog in a certain place. Item dialogs can only be used once, because the item will be picked up when you move over it; and sprite dialogs involve a sprite that you can't move past. So a locked exit won't do anything by itself, but the dialog can tell the player things, or alter variables.

example 4 - Random exits

The 5 random exits in the working demo share the same dialog. By using a shuffle list random exits are acheived, each with a different destination and a different transition. The actual exit is locked so that it's normal behaviour does not override the dialog exit. Note that the exit is locked at the end of the dialog. If the locking occurred at the start of the dialog, it wouldn't work, because all exits and endings are unlocked whenever you go through an exit, even one from within a dialog.

This is a random exit{shuffle
  - {exit "1" 3 14 "fade_w"}
  - {exit "1" 5 14 "fade_b"}
  - {exit "1" 7 14 "wave"}
  - {exit "1" 9 14 "tunnel"}
  - {exit "1" 11 14}
}{property locked true}

example 5 - Locked door requiring a key

This example uses an exit to get you through a door. It uses a branching dialog. If you don't have a key in your inventory, then the door is locked, and a message tells you that you need the key.

{
  - {item "key"} == 0 ?
     This door is locked and requires a key{property locked true}
  - else ?
    {property locked false}
}

Endings

Endings are similar to exits, but they don't have a destination. If an ending completes, the game will end. The ending dialog takes place against a plain background, not in your current room. As with exits, endings can be locked. This allows you to have an ending that will only function when certain conditions are met, such as when you are carrying the required items. If an ending is locked, the dialog will still run, but you will be returned to the room and the game will continaue after the end of the dialog.

Endings can also be caused from within a dialog. You might interact with a sprite, and if you displease them, they could kill you there and then.

Locked endings can be used in the same way as locked exits to provide repeatable, non-blocking dialog; but with the difference that the dialog takes place against a plain background.

example 6 - Locked ending

This ending is locked so that you can explore the behaviour without actually ending the game.

Endings finish the game, and take you away from the room. But we'll let you carry on for now.{property locked true}