Demo entry 6269599

Grabepra

   

Submitted by anonymous on Oct 16, 2016 at 12:13
Language: Python. Code size: 22.4 kB.

from tkinter import *
from winsound import *
import sys
import threading
import os
def music():
    os.system("music.wav")


##########################################################story##################################################
hometxt="""Grabepra - ©Rachel Sheppard.
Can you survive the most dangerous journey of your life?
Whilst reading, click and scroll in the blue textbox to read.
Scroll ALL the way... I mean it... ALL the way...
Click the → to enter but please check spellings.
Click the ⌂ to return home
Click the ♪ to play some music
Enter "play" to start the game..."""
ageovertxt="""You must be 12 or over or with a reponsible adult to play this game.
If you are over the age of 12 or have an adult with you enter "yes" otherwise enter "no"."""

planettxt="""A long time ago in a galaxy far far away there just happened to be a little planet bobbing away
in the vicinity of space.However, everything on the planet was everything but good. The sun was dying…
… And this meant that the sun would turn into a red giant and finally would cause the creation of a black hole. 
…This meant the planet was going to be sucked into it never to return…



NASA- Nearly and surely annihilated- has decided to send a brave soul up into space in search for another planet.
And that brave soul is YOU.
A clever NASA boffin says this: “We have located another planet, of the name Grabepra.
It is your quest to land on the planet, and 600 miles from your landing point will be a data point.
You must get the necessary data and return home.
Upon your return, if the data shows positive readings, NASA will begin a planet evacuation.”
1 Day gone…
2 Days gone…
Your quest begins!
Oh no…
***The lights dim***
Your spaceship is crash-landing
You: NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
You: I’m going to die!!!!!!!!!!!
Heartrate: ________________________________________________________________________
Heartrate: ___/\___/\___/\___/\___/\___/\___ /\___/\___/\___/\___/\___/\___/\___/\_
Serdia: Are you okay?
You: Who are you?
Serdia: I am your shipboard computer- I will be your travel buddy. Some call me Serdia.
You: What happened?
Serdia: Our ship was shot down by intergalactic guards, we cannot return home in it
You: Well what can we do?
Serdia: At the data point, there is a space pod. We must hurry, the might be some unfriendly natives.
Serdia: Are you willing to continue? Enter "ok" or "nope".
"""
endtxt="""You must have an adult with you- this game contains violence and gore. Play by entering "Yes" """
journeytxt=""" You begin your journey. 
After walking for miles you come across a forked pathway.
Serdia: What way are you going to go, my geo-location sensors have crashed, and they cannot work in this atmosphere.
Serdia: Are you going to go left, or right? Enter "left" or "right".
"""
lefttxt="""Serdia: I have a bad feeling about this
Up ahead is a gang of evil-looking GOBOS blocking your pathway?  You are about to turn back when a very large Gobo stands behind you,
looking menacingly down at you. Will you walk towards to evil gang, or dice the Gobo behind you? Enter "walk" or "dice".
"""
righttxt="""Serdia: The path ahead is clear we can continue onwards
You walk for an hour but begin to get tired, you must rest
You: let’s set up camp for the night in that hole in the ground
Serdia: *sarcastically* that looks so inviting
You: Since when can robot show emotions?
You set up camp and settle down for the night. You stare up through the hole at the stars. But your view is blocked by something green.
Serdia: A fat Huk has sat on the hole. We can’t get out
You: I know what to do!
You remove a feather duster from your bag.
You: I am either going to tickle him or stab him with it.
Serdia: Don’t---------
You: Should I stab, or tickle?
Enter "stab" or "tickle".
"""
walktxt="""You walk towards the gang and slowly draw your sword.
Too late! They swarm towards you and some more erupt from the ground. It’s a trap!
Serdia: Goodbyeeeeeeeeeeeeee!
Serdia was swallowed up by an emerging gobo.
You start hacking and slicing the air, desperate to save yourself. But it’s too late.
The emperor gobo grabs you by the neck and swallows you whole.
The end
"""
dicetxt="""You catch the gobo behind you by surprise and you dice him into gobo cubes.
You quickly gather them up and save them for your dinner later.
Serdia: Lets go
You run back and turn right.
Serdia: The path ahead is clear we can continue onwards
You walk for an hour but begin to get tired, you must rest
You: let’s set up camp for the night in that hole in the ground
Serdia: *sarcastically* that looks so inviting
You: Since when can robot show emotions?
You set up camp and settle down for the night. You stare up through the hole at the stars.
But your view is blocked by something green.
Serdia: A fat Huk has sat on the hole. We can’t get out
You: I know what to do!
You remove a feather duster from your bag.
You: I am either going to tickle him or stab him with it.
Serdia: Don’t---------
You: Should I stab, or tickle?
Enter "stab" or "tickle".
"""
stabtxt="""You stab the Huk. There is a tremendous roar
Roar!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You are staring up at the hole and something drips onto your face. And then something else drips onto your face.
Suddenly you are having a shower in some mysterious substance
Serdia: You dimwit
You: What have I done?
The substance is up to your knees
Serida: The Huk is bleeding, bleeding to death. We are going to drown in his blood.
10 minutes later- You die
The End
"""
tickletxt="""Your arm reaches up and holding on to the feather duster, tickles the Huk. As quickly as it sat down, it stands up and runs away.
You get out of the hole and stand up, brushing yourself down. You leave the hole and walk away from your camp.
After another hour of travelling, you decide to eat but realize you have nothing to eat but some stale crackers
Yum!
Serdia: My geo-sensors are still not working but my life signs detector shows a Cehm, a delicacy in spaces’ version of Earth’s KFC.
Not KFC but RFC- radiation fried Cehm.
You: So how do I catch one?
Serdia: It is very easy, just sing a song
You: I can’t sing to save my life
Serdia: Well you’ll starve to death otherwise
Will you sing or not? Enter "sing" or "quiet".
"""
quiettxt="""Serdia: You dimwit, you are going to die all alone with no food.
10 minutes later…
You are so tired and hungry you cannot move
1 hour later…
Heartbeat: ___/\____________/\__________/\___
1 hour 1 minute 1 second later…
Heartbeat: ___________________________________
You died!
"""
foodtxt="""♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫♫
Your ears hurt but your plan works, a Cehm comes running towards you.
Within 10 minutes Serdia has it cooking on the fire you conveniently just made. 
You: Ñam Ñam
Serdia: I told you it was nice
You: I think I am going to bed now…
Serdia: Night
You: Night
Time passed by and you wake up to the gentle feeling of Serdia punching you on the shoulder.
You: Why are you waking me up?
Serdia: The Dif'ua are stampeding.
You: The what are what?
Serdia: The Dif'ua are stampeding.
You: Well whatever that means it must be bad, let’s go!!!!!
Serdia: Wait we’ll get trampled on
You: But we have to get to the data point.
Serdia: It’s your choice…
Are you going to wait it out or take your chance and run?
Enter "wait" or "run".
"""
waittxt="""6 hours later you are still waiting
You hear footsteps behind you and turn to come face to face with…
You die 
"""
runtxt="""You dodge and duck and fall and pick yourself up over and over again.
You are scratched and bleeding and trampled and flattened but you have somehow managed to come out alive.
Clouds of dust have risen everywhere and you cannot see a thing.
Serdia: My short range sensors show the data point is within a 2 days walk, as long as we do not fall into any traps.
You: Let’s go
*pssps* *howl* *gnarl* *pssps pssps*
You: What’s that?
Serdia: My wiki sources tell me they are the rumoured ghosts of Grabepra, The Abandonded Stalkers,
they create sounds to scare the victims.
You: Well they’ve done a great job let’s go!!!!!!
You run as fast as your legs can carry you and don’t stop until you hear Serdia.
Serdia: STOP!!!!!!!!!!!!!!
You skid to a halt, just tipping over the edge of a volcano. 
Serdia: We are going to have to walk around this volcano. It will take us 4 hours
You:  Can we not just swing across to the other side.
Will you swing across of walk around? Enter "swing" or "cross".
"""
swingtxt="""You attach the rope to a branch hanging over the center of the whole.
You stand back run and leap holding on to the rope, but it snaps, you fall into the lava and a searing burning pain overcomes
you and your body is swallowed up.
The End!
"""
crosstxt="""You glumly start to walk around the rim of the volcano and a smell of Sulphur dioxide fills your nose.
The volcano is going to erupt
Serdia: Let’s go!!!!
You start to run towards the path on the other side, running, running, and running. But you are too late.
The ground starts to shake and lava starts to pour everywhere and volcanic bombs come raining down.
You don’t see a snaking path of lava coming towards you. It licks your ankles and you turn to see it.
You: Arrgh!
Serdia: No!
Serdia pulls you out the way. You fall to the ground and when you get up you see Serdia’s body floating lifelessly past in a river of lava.
You: NO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
SERDIA SCARAFICED HERSELF FOR YOU!
You: I must complete my mission, for Serdia.
Your brain: Why? You cannot do it without her. Just curl up and die.
Do you curl up and die or keep going?
Enter "curl up" or "keep going".
"""
dietxt="""You curl up and let death take you away...
The end
"""
answertxt="""After tiring hours of walking, fighting, singing for Cehms and the continuing battle of survival
you see a flashing dataspace area ahead.
his is it, the research base. You have finally reached it. But you mustn’t celebrate yet. 
You use the last of your energy to run to the door but it is locked. You see a panel on the wall. It says:
Sign: Are you human? Answer this puzzle to get in. How many triangles are in it?
To continue the story select the answer to the puzzle. Or enter "give up" to give up. 
"""
giveup1txt="""You sit by the door and let death take you away.
You die.
"""
answer2txt="""The door swings open and you enter. It is dark and all the equipment is covered in cobwebs and ghost-like plastic sheets.
You know what you have to do and you walk over to a module. The computer slowly whirs into life but requires a code of four letters.
You look around, and on the bottom of a desk is another puzzle- the answer being the code to the computer. 
The puzzle says this:
Mary's mum has four children.
The first child is called April.
The second May.
The third June.
What is the name of the fourth child?
"""
marytxt="""The computer unlocks itself and the data you need is up on the screen.
You enter your DTS or data transfer stick and the data is saved onto it. You are about to leave when you realize something.
You need to find that space- pod to get home. You load up a map and search for space pod.
There are 2 possibilities.
You have a limited amount of time before it becomes night time, and you don’t want to be out in the dark so you must choose-
the red dot or the green dot.
Enter "red" or "green".
"""
redtxt="""You chose well. You walk for 10 minutes and find a gleaming space pod. You get in a press the launch trigger…

3…

…2…

…1…

…Blast Off…

…You fall unconscious…

You reach your home planet and wake up to the gentle nudging of that clever NASA boffin. Yes- he’s back.
His name is Bob. 
Bob: Congratulations, you did very well.
You: Thanks Bob.
Bob: The data shows it is a very dangerous planet, maybe we will not evacuate over there.
Did you find it dangerous? Type "yeah" or "never" to continue.
"""
greentxt="""Oh Dear…
…You seem to have chosen the green area…
…Bad decision…
You reach the door that leads to the green area.
You reach for the handle and pull it
The door swings open and you walk through only to find a Gobo inside the room.
You die
"""
finishtruetxt="""Bob: Well done you brave soul. But there is one last thing you need to do.
You: What?!
Bob: Pay a visit to Griri, Grabepra’s twin planet.
You: …………………………………………
COMPLETE YOUR NEXT MISSION IN…
… GRABEPRA 2
Type "next" to continue.








Serdia: I’m alive…
"""
finishfalsetxt="""Stop lying, you were so scared, I can see your hands trembling.
Bob: Well done you brave soul. But there is one last thing you need to do.
You: What?!
Bob: Pay a visit to Griri, Grabepra’s twin planet.
You: …………………………………………
COMPLETE YOUR NEXT MISSION IN…
… GRABEPRA 2
Type "next" to continue.








Serdia: I’m alive…
"""
endscreentxt = """Thank you ever so much for playing. Bye, Bye... To play again type "play"."""

##variables
canvas_height = 250
canvas_width = 603
canvas_color = "black"
background = "space_11.gif"
x_coord = 125
y_coord = canvas_height
global entered_text
global last_thing

##main
window = Tk()
window.title("Grabepra -- It's Your Choice")
canvas = Canvas(bg=canvas_color, height=canvas_height,
                width=canvas_width, highlightthickness=0)
scene = PhotoImage(file=background)
canvas.create_image(0, 0, image=scene, anchor=NW)
canvas.pack()

homepic1 = PhotoImage(file="space_11.gif")
def homepic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=homepic1, anchor=S)

def click():
    global entered_text
    entered_text = entry.get()  # collect text from text entry box
    output.delete(0.0, END)  # clear text box
    ifstory()

def home():
    output.delete(0.0, END)
    output.insert(END, hometxt)
    hometxtpic()
    if entered_text == "play":
        output.insert(END, ageovertxt)
        entry.delete(END, END)
    else:
        END



bottomframe = Frame(window)
bottomframe.pack()

# create label
Label(bottomframe, text="What will you do?").grid(row=3, column=0, sticky=W)

# create text entry box
entry = Entry(bottomframe, width=50, bg="Cadet Blue")
entry.grid(row=4, column=0, sticky=W)

# Add a submit button:
Button(bottomframe, text="→", width=5, command=click).grid(row=4,column=1, sticky=W)
Button(bottomframe, text="⌂", width=5, command=home).grid(row=3,column=1, sticky=W)
Button(bottomframe, text="♪", width=5, command=music).grid(row=5,column=1, sticky=W)

# create another label
Label(bottomframe, text="\n").grid(row=1, column=0, sticky=W)

# create text box
output = Text(bottomframe, width=75, height=8, wrap=WORD, background="Slate Blue")
output.grid(row=1, column=0, columnspan=2, sticky=W)
output.insert(END,hometxt)
## load images for bottom buttons:

age = PhotoImage(file="12age.gif")
answerinto = PhotoImage(file="answerinto.gif")
byebye = PhotoImage(file="byebye.gif")
cross = PhotoImage(file="cross.gif")
dice = PhotoImage(file="dice.gif")
die = PhotoImage(file="die.gif")
end = PhotoImage(file="end.gif")
food = PhotoImage(file="food.gif")
greennew = PhotoImage(file="greennew.gif")
left = PhotoImage(file="left.gif")
leftnew = PhotoImage(file="leftnew.gif")
mary = PhotoImage(file="mary.gif")
puzzle = PhotoImage(file="puzzle.gif")
quiet = PhotoImage(file="quiet.gif")
red = PhotoImage(file="red.gif")
rightnew = PhotoImage(file="rightnew.gif")
run = PhotoImage(file="run.gif")
serdia = PhotoImage(file="serdia.gif")
stab = PhotoImage(file="stab.gif")
swing = PhotoImage(file="swing.gif")
tickle = PhotoImage(file="tickle.gif")
wait = PhotoImage(file="wait.gif")
walktxt = PhotoImage(file="walktxt.gif")

def agepic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=age, anchor=S)
def answerintopic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=answerinto, anchor=S)
def byebyepic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=byebye, anchor=S)
def crosspic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=cross, anchor=S)

def dicepic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=dice, anchor=S)
def diepic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=die, anchor=S)

def endpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=end, anchor=S)
def foodpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=food, anchor=S)
def singpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=food, anchor=S)
def greennewpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=greennew, anchor=S)
def homepic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=home, anchor=S)

def leftpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=left, anchor=S)
def leftnewpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=leftnew, anchor=S)

def marypic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=mary, anchor=S)
def puzzlepic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=puzzle, anchor=S)

def quietpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=quiet, anchor=S)
def redpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=red, anchor=S)

def rightnewpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=rightnew, anchor=S)
def runpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=run, anchor=S)

def serdiapic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=serdia, anchor=S)
def stabpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=stab, anchor=S)

def swingpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=swing, anchor=S)
def ticklepic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=tickle, anchor=S)
def greenpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=greennew, anchor=S)
def waitpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=wait, anchor=S)
def walktxtpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=walktxt, anchor=S)
def hometxtpic():
    canvas.delete(ALL)
    canvas.create_image(x_coord, y_coord, image=homepic1, anchor=S)
    
def ifstory():
    global entered_text
    global last_thing
    entered_text = (entered_text.lower())
    if entered_text == "play":
        output.insert(END, ageovertxt)
        entry.delete(END, END)
        agepic()
    elif entered_text == "yes":
        output.insert(END, planettxt)
        entry.delete(END, END)
        serdiapic()
    elif entered_text == "no":
        output.insert(END, endtxt)
        entry.delete(END, END)
        endpic()
    elif entered_text == "ok":
        output.insert(END, journeytxt)
        entry.delete(END, END)
        leftpic()
    elif entered_text == "nope":
        output.insert(END, giveup1txt)
        entry.delete(END, END)
    elif entered_text == "left":
        output.insert(END, lefttxt)
        entry.delete(END, END)
        leftnewpic()
    elif entered_text == "right":
        output.insert(END, righttxt)
        entry.delete(END, END)
        rightnewpic()
    elif entered_text == "walk":
        output.insert(END, walktxt)
        entry.delete(END, END)
        walktxtpic()
    elif entered_text == "dice":
        output.insert(END, dicetxt)
        entry.delete(END, END)
        dicepic()
    elif entered_text == "stab":
        output.insert(END, stabtxt)
        entry.delete(END, END)
        stabpic()
    elif entered_text == "tickle":
        output.insert(END, tickletxt)
        entry.delete(END, END)
        ticklepic()
    elif entered_text == "sing":
        output.insert(END, foodtxt)
        entry.delete(END, END)
        singpic()
    elif entered_text == "quiet":
        output.insert(END, quiettxt)
        entry.delete(END, END)
        quietpic()
    elif entered_text == "wait":
        output.insert(END, waittxt)
        entry.delete(END, END)
        waitpic()
    elif entered_text == "run":
        output.insert(END, runtxt)
        entry.delete(END, END)
        runpic()
    elif entered_text == "swing":
        output.insert(END, swingtxt)
        entry.delete(END, END)
        swingpic()
    elif entered_text == "cross":
        output.insert(END, crosstxt)
        entry.delete(END, END)
        crosspic()
    elif entered_text == "curl up":
        output.insert(END, dietxt)
        entry.delete(END, END)
        diepic()
    elif entered_text == "keep going":
        output.insert(END, answertxt)
        entry.delete(END, END)
        puzzlepic()
    elif entered_text == "64":
        output.insert(END, answer2txt)
        entry.delete(END, END)
        answerintopic()
    elif entered_text == "give up":
        output.insert(END, giveup1txt)
        entry.delete(END, END)
        diepic()
    elif entered_text == "mary":
        output.insert(END, marytxt)
        entry.delete(END, END)
        marypic()
    elif entered_text == "red":
        output.insert(END, redtxt)
        entry.delete(END, END)
        redpic()
    elif entered_text == "green":
        output.insert(END, greentxt)
        entry.delete(END, END)
        greenpic()
    elif entered_text == "yeah":
        output.insert(END, finishtruetxt)
        entry.delete(END, END)
        byebyepic()
    elif entered_text == "never":
        output.insert(END, finishfalsetxt)
        entry.delete(END, END)
        byebyepic()
    elif entered_text == "next":
        output.insert(END, endscreentxt)
        entry.delete(END, END)
        endpic()

window.iconbitmap(r"favicon.ico")
window.mainloop()

This snippet took 0.02 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).