πŸ€‘ Indie game storeπŸ™Œ Free gamesπŸ˜‚ Fun games😨 Horror games
πŸ‘· Game development🎨 AssetsπŸ“š Comics
πŸŽ‰ Sales🎁 Bundles

struggling with variables

A topic by jbradleywrites created Mar 06, 2018 Views: 285 Replies: 14
Viewing posts 1 to 6

Hi all,

I'm new to Bitsy and I'm struggling in creating variables. Trying to create one where when a player has all four items, it triggers a specific ending when the user goes to the ending point. Suggestions would be incredibly helpful.

(Edited 1 time)

I think you could use hidden item which contain the ending text. Also place an exit on the same tile to teleport the player to the exit room. The end room could be a room with word The End on it. Hope this helps

But how do you make it so that the text displays before you are sent to the new room? I've been trying to do this and every single time, the "room exit" occurs before the text.

May be check this https://github.com/seleb/bitsy-hacks

I think the best practice for accomplishing this without hacks is two steps:

  1. Hidden item before exit that performs the logic to see which ending text the player should be shown. This item stores the ending text to a variable.
  2. Ending displays appropriate ending text using 'say'

I wrote a tutorial which covers this and variables in general: https://ayolland.itch.io/trevor/devlog/29520/bitsy-variables-a-tutorial

 

I'm working on a game with a similar mechanic, but it's been fiddly to implement.

You could try creating a variable for the total number of items and add one to it each time the player picks up an item. Then at the ending point, create a sprite or an item with conditional dialogue that checks the value of that variable and use the end from dialogue Bitsy hack to set the ending based on the total number of items.

How do I write a variable, though?

using the inventory tab :)

That answers a "what do I use to write variables" question. What I really need to know is how one writes variables in the platform. There aren't clear instructions on how to do so in Bitsy.

you mean show their value in the text if that is the question then use that {say VarName} in the text.

I think I need an example or a step by step to understand it. If there is one that’s clear that you can refer me to, I’d love to read it. 

Check these links. they might not be the best tutorials but they might help :)

https://cephalopodunk.itch.io/bullshit-fish-names/devlog/23122/time-for-some-ram...

https://itch.io/t/194820/saying-variables

thanks for the links. I shall check them out. 

Aye. The cephalopodunk tutorials are the best.

Hey,  just in case anyone is poking around this thread in the future for answers about variables,  wrote a tutorial covering all this:

https://ayolland.itch.io/trevor/devlog/29520/bitsy-variables-a-tutorial