Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to make a conditional answer buttons? #1

Open
ProgrammingLife opened this issue Jan 19, 2024 · 1 comment
Open

Is it possible to make a conditional answer buttons? #1

ProgrammingLife opened this issue Jan 19, 2024 · 1 comment

Comments

@ProgrammingLife
Copy link

Let's say I wanna create a novel with 10 endings. Is it possible to make a conditional answer buttons that will lead a story to another novel ending?

@HalfstarDev
Copy link
Owner

You can use Choices and If-Else to create conditional choices.

A simple choice would work like this:

> Open left door.
  jump left
> Open right door.
  jump right

And you would continue at label left or label right depending on the choice of the player.

You could put the choice in an If-Else-block, for example to add a third choice if you have a key:

if has_key
  > Open left door.
    jump left
  > Open right door.
    jump right
  > Open locked door.
    jump locked_door
else
  > Open left door.
    jump left
  > Open right door.
    jump right

I'd like to add more options to customize choices in the future, like having an if-condition for each individual answer. If you have a scenario that would not work with the method above, you can share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants