Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nbogie
Created September 20, 2019 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbogie/8ba37a9b4a9a0b9dae0995b1f49a05c4 to your computer and use it in GitHub Desktop.
Save nbogie/8ba37a9b4a9a0b9dae0995b1f49a05c4 to your computer and use it in GitHub Desktop.
from pypercard import Inputs, CardApp, Card
import random
my_cards = [
Card(
"entrance",
text="You are in the top of a tall tower ,a locked door to the left and a window to the right",
buttons=[
{"label": "Try and pick the lock", "target": "locked door"},
{"label": "Go out of the window", "target": "falling"},
],
),
Card("locked door", text="You fumble with the lock and it falls of, it wasn't locked",
buttons=[{"label":"Go through the door", "target":"staircase"}]),
Card(
"falling",
text="You fall out of the sky and into the moat",
background="blue",
buttons=[{"label":"run out of the moat", "target":"shore"}],
auto_advance=2,
auto_target="drowning",
),
Card(
"shore",
text="You stumble onto the floor and see a room with singe marks on it.",
buttons =[{"label":"investigate the room","target":"dragon_room"},{"label":"jump right back in the moat","target":"drowning"}]
,),
Card(
"drowning",
text="You Drowned",
buttons=[{"label":"return to the start", "target":"entrance"}],
background="red",
),
Card(
"staircase",
text="You see singe marks on the door",
buttons=[{"label":"go back", "target":"entrance"},{"label":"Investigate","target":"dragon_room"}],
)
]
app = CardApp(stack=my_cards)
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment