Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // My entry for the Ludum Dare competition
- GLOBAL i, e, h, x, y, z, w
- FUNCTION START()
- {
- GFX.WRITELINE("This is my entry for the Ludum Dare competition")
- GFX.WRITELINE("It is an interactive text adventure based on the theme")
- GFX.WRITELINE("Tiny World")
- GFX.WRITELINE("When an option arises, type in the number of your choice")
- GFX.WRITELINE("Sometime, during the battles, the input of a number doesn't")
- GFX.WRITELINE("return anything, just enter the number again and it works =)")
- GFX.WRITELINE("Press any key to begin")
- KEY.WAIT()
- GFX.CLEAR()
- Prologue()
- Scenario1()
- }
- FUNCTION Prologue()
- {
- GFX.WRITELINE("You wake up on a deserted beach, absolutely soaked and")
- GFX.WRITELINE("coughing up sea water.")
- GFX.WRITELINE("The last thing you remember is flying through the Bermuda")
- GFX.WRITELINE("Triangle, when suddenly everything stopped working and")
- GFX.WRITELINE("you plunged into the depths of the Atlantic ocean.")
- GFX.WRITELINE("press any key to continue")
- KEY.WAIT()
- GFX.CLEAR()
- }
- FUNCTION Scenario1()
- {
- GFX.WRITELINE("Once you catch your breath you take in your surroundings.")
- GFX.WRITELINE("The beach stretches into the distance in both directions.")
- GFX.WRITELINE("Inland, past the beach, the terrain goes up into a hill.")
- GFX.WRITELINE("You can tell by the position of the sun in the sky that")
- GFX.WRITELINE("inland is north and it's currently about midday.")
- GFX.WRITELINE("Do you:")
- GFX.WRITELINE("1 - start walking east along the beach,")
- GFX.WRITELINE("2 - start walking west along the beach,")
- GFX.WRITELINE("3 - start walking inland, to the north")
- KEY.READLINE()
- LET i = RETVAL
- IF i = 1
- {
- Option1()
- }
- IF i = 2
- {
- Option2()
- }
- IF i = 3
- {
- Option3()
- }
- }
- FUNCTION Option1()
- {
- GFX.CLEAR()
- GFX.WRITELINE("You start to walk east along the beach, after what feels")
- GFX.WRITELINE("like 30 minutes it starts to get dark, which surprises")
- GFX.WRITELINE("you as you could have sworn it was about midday when you")
- GFX.WRITELINE("set off. You continue to walk through the night and after")
- GFX.WRITELINE("what feels like an hour, you see the sun rising,")
- GFX.WRITELINE("this perplexes you and you almost miss the footsteps")
- GFX.WRITELINE("in the sand starting after a man sized indentation")
- GFX.WRITELINE("something clicks in your brain, what is it?")
- GFX.WRITELINE("1 - someone else must be here, i should follow their tracks")
- GFX.WRITELINE("2 - Those must be my footsteps, this must be a tiny world")
- KEY.READLINE()
- LET i = RETVAL
- GFX.CLEAR()
- IF i = 1
- {
- Option5()
- }
- IF i = 2
- {
- Option6()
- }
- }
- FUNCTION Option2()
- {
- GFX.CLEAR()
- GFX.WRITELINE("You start to walk west along the beach, after what feels")
- GFX.WRITELINE("like 30 minutes it starts to get dark, which surprises")
- GFX.WRITELINE("you as you could have sworn it was about midday when you")
- GFX.WRITELINE("set off. Also, the sun appears to be setting in the east.")
- GFX.WRITELINE("You continue to walk through the night and after what")
- GFX.WRITELINE("feels like an hour, you see the sun rising in the west,")
- GFX.WRITELINE("this perplexes you and you almost miss the footsteps")
- GFX.WRITELINE("in the sand starting after a man sized indentation")
- GFX.WRITELINE("something clicks in your brain, what is it?")
- GFX.WRITELINE("1 - someone else must be here, i should follow their tracks")
- GFX.WRITELINE("2 - Those must be my footsteps, this must be a tiny world")
- KEY.READLINE()
- LET i = RETVAL
- GFX.CLEAR()
- IF i = 1
- {
- Option5()
- }
- IF i = 2
- {
- Option6()
- }
- }
- FUNCTION Option3()
- {
- GFX.CLEAR()
- GFX.WRITELINE("You start to climb the hill and after a few minutes you")
- GFX.WRITELINE("reach the summit and look down the other side.")
- GFX.WRITELINE("To your dismay, the other side is just another endless")
- GFX.WRITELINE("beach, going off in both directions, it appears")
- GFX.WRITELINE("that you have awoken on a long, thin island.")
- GFX.WRITELINE("Do you:")
- GFX.WRITELINE("1 - keep walking along the ridge,")
- GFX.WRITELINE("2 - return to the beach.(walk along beach before choosing 1)")
- KEY.READLINE()
- LET i = RETVAL
- GFX.CLEAR()
- IF i = 1
- {
- Option4()
- }
- IF i = 2
- {
- Scenario1()
- }
- }
- FUNCTION Option4()
- {
- GFX.WRITELINE("You continue to walk along the ridge, which gets higher")
- GFX.WRITELINE("and turns into a mountain, it starts to get dark and")
- GFX.WRITELINE("you suddenly realise how exhausted you are so you head")
- GFX.WRITELINE("into a nearby cave and fall asleep.")
- GFX.WRITELINE("A slithering sound wakes you up and you turn around to see")
- GFX.WRITELINE("a snail the size of an adolescent bear approaching with")
- GFX.WRITELINE("razor sharp teeth ready to chew on your skull.")
- GFX.WRITELINE("you see a sharp rock lying on the ground next to you and a")
- GFX.WRITELINE("plank of wood on the other side of the cave so you pick them")
- GFX.WRITELINE("both up and prepare for battle.")
- GFX.WRITELINE("press any key to fight")
- KEY.WAIT()
- GFX.CLEAR()
- LET x = 1
- LET h = 5
- LET y = 0
- Fight()
- LET h = h + y
- Scenario2()
- }
- FUNCTION Fight()
- {
- WHILE x > 0
- {
- GFX.WRITELINE("1 - Stab (Stab beats Swing)")
- GFX.WRITELINE("2 - Block (Block beats Stab)")
- GFX.WRITELINE("3 - Swing (Swing beats Block)")
- GFX.WRITELINE("You currently have ")
- GFX.WRITE(h)
- GFX.WRITE(" health left")
- GFX.NEWLINE()
- GFX.WRITELINE("The enemy has ")
- GFX.WRITE(x)
- GFX.WRITE(" health left")
- GFX.NEWLINE()
- KEY.READLINE()
- LET i = RETVAL
- UTIL.RANDOM(3)
- LET e = RETVAL
- IF i = 1
- {
- IF e = 2
- {
- Miss()
- }
- IF e = 3
- {
- Hit()
- }
- }
- IF i = 2
- {
- IF e = 1
- {
- Hit()
- }
- IF e = 3
- {
- Miss()
- }
- }
- IF i = 3
- {
- IF e = 1
- {
- Miss()
- }
- IF e = 2
- {
- Hit()
- }
- }
- IF i = e
- {
- Tie()
- }
- GFX.CLEAR()
- IF h = 0
- {
- Death()
- }
- }
- }
- FUNCTION Hit()
- {
- GFX.NEWLINE()
- GFX.WRITELINE("You manage to hit the enemy, dealing 1 damage to it")
- TIMER.SLEEP(150)
- LET x = x - 1
- }
- FUNCTION Tie()
- {
- GFX.NEWLINE()
- GFX.WRITELINE("You both do the same thing, no damage is dealt")
- TIMER.SLEEP(150)
- }
- FUNCTION Miss()
- {
- GFX.NEWLINE()
- GFX.WRITELINE("The enemy hits you, dealing 1 damage")
- TIMER.SLEEP(150)
- LET h = h - 1
- LET y = y + 1
- }
- FUNCTION Option5()
- {
- GFX.WRITELINE("You follow the tracks through the night and what feels like")
- GFX.WRITELINE("2 hours later you come across the same tracks and man shaped")
- GFX.WRITELINE("indentation except with more tracks next to it this time.")
- GFX.WRITELINE("This makes you realise that you are somehow in a tiny world.")
- TIMER.SLEEP(300)
- GFX.CLEAR()
- Option6()
- }
- FUNCTION Option6()
- {
- GFX.WRITELINE("After making this realisation, you decide to head north")
- GFX.WRITELINE("to try and find some way of returning to Earth.")
- TIMER.SLEEP(300)
- GFX.CLEAR()
- Option3()
- }
- FUNCTION Death()
- {
- GFX.CLEAR()
- GFX.WRITELINE("You have died, your adventure is over.")
- GFX.WRITELINE("Press any key")
- KEY.WAIT()
- GFX.IMAGELOAD("yousrc:game over")
- GFX.IMAGEDRAW(RETVAL,0,150)
- GFX.SHOW()
- }
- FUNCTION Scenario2()
- {
- GFX.WRITELINE("The snail keels over dead and you break off a piece of its")
- GFX.WRITELINE("shell, you manage to stick it to your 'shield' using")
- GFX.WRITELINE("the slime the snail left in it's trail, making your shield")
- GFX.WRITELINE("more durable and giving you more health.")
- LET h = 6
- GFX.WRITELINE("You poke your head out of the cave to discover that it is")
- GFX.WRITELINE("still dusk, then it dawns on you that this Tiny World must")
- GFX.WRITELINE("not be moving and that the 'time' of day only changes when")
- GFX.WRITELINE("you change your position on the Tiny World.")
- GFX.WRITELINE("You search the cave and discover a small crevice right at")
- GFX.WRITELINE("the back where you think you can see a dim light glowing.")
- GFX.WRITELINE("Press any key to go into the crevice")
- KEY.WAIT()
- GFX.CLEAR()
- Option7()
- }
- FUNCTION Option7()
- {
- GFX.WRITELINE("You squeeze through the gap, sucking your stomach in")
- GFX.WRITELINE("to avoid getting stuck and emerge out into a small room")
- GFX.WRITELINE("containing a large iron chest flanked by two suits of armour")
- GFX.WRITELINE("holding lit torches in their hands. You slowly approach with")
- GFX.WRITELINE("weapons drawn and when nothing happens you lower your")
- GFX.WRITELINE("defenses and stand in front of the chest, you decide to")
- GFX.WRITELINE("Open the chest to see what goodies lie inside.")
- GFX.WRITELINE("Press any key to open the chest")
- KEY.WAIT()
- GFX.CLEAR()
- Option9()
- }
- FUNCTION Option8()
- {
- GFX.WRITELINE("You ascend the mountain and reach the summit within the hour")
- GFX.WRITELINE("on closer inspection, it is actually a dormant volcano")
- GFX.WRITELINE("rather than a mountain and you can see a tunnel entrance in")
- GFX.WRITELINE("the crater, with a ledge spiralling down to it, you start")
- GFX.WRITELINE("descending the spiral and when you get near the tunnel")
- GFX.WRITELINE("entrance, you notice a gap in the trail that drops into the")
- GFX.WRITELINE("lava below. Do you:")
- GFX.WRITELINE("1 - Risk jumping the gap")
- GFX.WRITELINE("2 - lay your plank of wood across the gap and walk across it")
- KEY.READLINE()
- LET i = RETVAL
- GFX.CLEAR()
- IF i = 1
- {
- Option10()
- }
- IF i = 2
- {
- Option11()
- }
- }
- FUNCTION Option9()
- {
- GFX.WRITELINE("It takes all of your strength to lift the lid and when you")
- GFX.WRITELINE("do, you are disappointed to find that all that is in the")
- GFX.WRITELINE("chest is a scroll, you open it and it reads:")
- GFX.WRITELINE("'HAHAHAHAH!' when you finish reading, more text appears,")
- GFX.WRITELINE("as if someone is writing it there and then, it reads:")
- GFX.WRITELINE("'I trapped you hear on this Tiny World and the only way back")
- GFX.WRITELINE("to Earth is through the portal in my study, deep inside the")
- GFX.WRITELINE("planet, be warned, there are many traps and tests you must")
- GFX.WRITELINE("overcome to reach me.' When you finished reading it")
- GFX.WRITELINE("it becomes apparent that your captor is finished and that")
- GFX.WRITELINE("you should return to the mountainside. As you turn around")
- GFX.WRITELINE("you hear two thuds and realise that the suits of armour have")
- GFX.WRITELINE("become animated and have blocked your escape. You attempt to")
- GFX.WRITELINE("hit one of them but your weapons do nothing against their")
- GFX.WRITELINE("armour. The other one swings at you his torch and you try to")
- GFX.WRITELINE("deflect it with your stone. The torch's head snaps off and")
- GFX.WRITELINE("falls into a nearby puddle, which puts it out. As soon as")
- GFX.WRITELINE("the flame is distinguished, the suit of amour falls to the")
- GFX.WRITELINE("ground and clatters everywhere, knocking both you, and the")
- GFX.WRITELINE("other suit of armour over, fortunately, the flame from the")
- GFX.WRITELINE("other suit of armour lands in the puddle and is also")
- GFX.WRITELINE("distinguished, removing the life force from the suit of")
- GFX.WRITELINE("armour. You try on some of the armour but the only thing")
- GFX.WRITELINE("that fits is a helmet, giving you more health.")
- LET h = h + 2
- GFX.WRITELINE("press any key to return to the mountainside")
- KEY.WAIT()
- GFX.CLEAR()
- Option8()
- }
- FUNCTION Option11()
- {
- GFX.WRITELINE("You lay your plank of wood across and gap and start to cross")
- GFX.WRITELINE("Halfway there, you hear a crack and the plank falls away")
- GFX.WRITELINE("beneath you and you fall as well, you grab onto the nearest")
- GFX.WRITELINE("thing. Is it:")
- GFX.WRITELINE("1 - a gutting out rock")
- GFX.WRITELINE("2 - a plant root")
- KEY.READLINE()
- LET i = RETVAL
- GFX.CLEAR()
- IF i = 1
- {
- GFX.WRITELINE("You grab onto the rock but it was loose and you plummet")
- GFX.WRITELINE("to your death into the lava below, screaming as you do so.")
- TIMER.SLEEP(500)
- Death()
- }
- IF i = 2
- {
- GFX.WRITELINE("You grab onto the plant root and fortunately it takes your")
- GFX.WRITELINE("weight and you pull yourself up, unfortunately, you now have")
- GFX.WRITELINE("one less health due to the loss of your shield.")
- LET h = h - 1
- Option12()
- }
- }
- FUNCTION Option12()
- {
- GFX.WRITELINE("Once on the other side, you enter the tunnel which")
- GFX.WRITELINE("immediatley expands into a large cave containing 2 more")
- GFX.WRITELINE("Giant snails, the first one sees you and attacks.")
- GFX.WRITELINE("Press any key to fight")
- KEY.WAIT()
- LET x = 1
- LET y = 0
- Fight()
- GFX.WRITELINE("You kill the first snail but the other sees you and")
- GFX.WRITELINE("attacks before you have time to heal.")
- GFX.WRITELINE("Press any key to fight")
- KEY.WAIT()
- LET x = 1
- Fight()
- LET h = h + y
- GFX.WRITELINE("Once both snails are dead, you crack their shells combine")
- GFX.WRITELINE("bits of them with your rock to create a makeshift")
- GFX.WRITELINE("sword, which lowers the amount of health enemies have.")
- GFX.WRITELINE("You continue on into another tunnel until you come to a")
- GFX.WRITELINE("large iron door with a very large bear guarding it")
- GFX.WRITELINE("Press any key to fight")
- KEY.WAIT()
- LET x = 3
- Fight()
- LET h = h + y
- LET h = h + 2
- LET z = 0
- LET w = 0
- GFX.WRITELINE("The bear collapses and you skin it, making a better shield")
- GFX.WRITELINE("you also remove its teeth, you can either:")
- GFX.WRITELINE("1 - attach them to your 'sword' so that enemies have less HP")
- GFX.WRITELINE("2 - attach them to your shield so that you have more HP")
- KEY.READLINE()
- LET i = RETVAL
- GFX.CLEAR()
- IF i = 1
- {
- Option13()
- }
- IF i = 2
- {
- Option14()
- }
- }
- FUNCTION Option10()
- {
- GFX.WRITELINE("You take a run up and jump higher and further than ever")
- GFX.WRITELINE("before in your life, easily clearing the gap.")
- Option12()
- }
- FUNCTION Option13()
- {
- LET w = w + 1
- Scenario3()
- }
- FUNCTION Option14()
- {
- LET z = z + 1
- Scenario3()
- }
- FUNCTION Scenario3()
- {
- GFX.WRITELINE("You have open the iron doors and enter a very fancy looking")
- GFX.WRITELINE("room. 'I've been expecting you' comes a weary voice from")
- GFX.WRITELINE("across the room, a large chair swivels around to reveal an")
- GFX.WRITELINE("old, shrivelled up man with a very long beard.")
- GFX.WRITELINE("'Let me out of here' you yell, 'not until you defeat me' he")
- GFX.WRITELINE("replies. The old man then jumps out of his chair like a")
- GFX.WRITELINE("ninja and takes stance infront of you.")
- GFX.WRITELINE("Press any key to fight")
- KEY.WAIT()
- LET x = 6 - w
- LET h = h + z
- Fight()
- GFX.WRITELINE("The old man's corspe is blasted back onto his chair, which")
- GFX.WRITELINE("topples over onto a very suspicious looking, large, red")
- GFX.WRITELINE("button. 'SELF DESTRUCT SEQUENCE INITIATED, SELF DESTRUCT IN")
- GFX.WRITELINE("T MINUS 30 SECONDS' a loud, robotic voice says.")
- GFX.WRITELINE("You look over to your left, to see a whirling portal at the")
- GFX.WRITELINE("end of the room, however, there is a large lava pit between")
- GFX.WRITELINE("you and the portal with three rope swings to choose from:")
- GFX.WRITELINE("1 - swing on the left one")
- GFX.WRITELINE("2 - swing on the centre one")
- GFX.WRITELINE("3 - swing on the right one")
- KEY.READLINE()
- LET i = RETVAL
- GFX.CLEAR()
- IF i = 1
- {
- Option15()
- }
- IF i = 2
- {
- Option16()
- }
- IF i = 3
- {
- Option15()
- }
- }
- FUNCTION Option16()
- {
- GFX.WRITELINE("You grab the middle rope and swing across, you hear a creak")
- GFX.WRITELINE("and suddenly the rope snaps, plunging you into the deadly")
- GFX.WRITELINE("lava below, your screams are cut short, so close, yet so far")
- TIMER.SLEEP(500)
- Death()
- }
- FUNCTION Option15()
- {
- GFX.WRITELINE("You grab the rope and swing across, safely landing on the")
- GFX.WRITELINE("other side, you dive into the portal just as you hear:")
- GFX.WRITELINE("'SELF DESTRUCT IN T MINUS 5 4 3 2-'.")
- GFX.WRITELINE("Press any key to continue")
- KEY.WAIT()
- GFX.CLEAR()
- End()
- }
- FUNCTION End()
- {
- GFX.WRITELINE("You wake up on a deserted beach, absolutely soaked and")
- GFX.WRITELINE("coughing up sea water.")
- GFX.WRITELINE("The last thing you remember is flying through the Bermuda")
- GFX.WRITELINE("Triangle, when suddenly everything stopped working and")
- GFX.WRITELINE("you plunged into the depths of the Atlantic ocean.")
- GFX.WRITELINE("press any key to continue...")
- KEY.WAIT()
- GFX.CLEAR()
- GFX.IMAGELOAD("yousrc:game over")
- LET i = RETVAL
- GFX.IMAGEDRAW(i,0,150)
- GFX.SHOW()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement