Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2012
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.99 KB | None | 0 0
  1. // My entry for the Ludum Dare competition
  2. GLOBAL i, e, h, x, y, z, w
  3. FUNCTION START()
  4. {
  5. GFX.WRITELINE("This is my entry for the Ludum Dare competition")
  6. GFX.WRITELINE("It is an interactive text adventure based on the theme")
  7. GFX.WRITELINE("Tiny World")
  8. GFX.WRITELINE("When an option arises, type in the number of your choice")
  9. GFX.WRITELINE("Sometime, during the battles, the input of a number doesn't")
  10. GFX.WRITELINE("return anything, just enter the number again and it works =)")
  11. GFX.WRITELINE("Press any key to begin")
  12. KEY.WAIT()
  13. GFX.CLEAR()
  14. Prologue()
  15. Scenario1()
  16. }
  17. FUNCTION Prologue()
  18. {
  19. GFX.WRITELINE("You wake up on a deserted beach, absolutely soaked and")
  20.  
  21. GFX.WRITELINE("coughing up sea water.")
  22.  
  23. GFX.WRITELINE("The last thing you remember is flying through the Bermuda")
  24.  
  25. GFX.WRITELINE("Triangle, when suddenly everything stopped working and")
  26.  
  27. GFX.WRITELINE("you plunged into the depths of the Atlantic ocean.")
  28. GFX.WRITELINE("press any key to continue")
  29. KEY.WAIT()
  30. GFX.CLEAR()
  31. }
  32. FUNCTION Scenario1()
  33. {
  34. GFX.WRITELINE("Once you catch your breath you take in your surroundings.")
  35.  
  36. GFX.WRITELINE("The beach stretches into the distance in both directions.")
  37.  
  38. GFX.WRITELINE("Inland, past the beach, the terrain goes up into a hill.")
  39.  
  40. GFX.WRITELINE("You can tell by the position of the sun in the sky that")
  41.  
  42. GFX.WRITELINE("inland is north and it's currently about midday.")
  43. GFX.WRITELINE("Do you:")
  44.  
  45. GFX.WRITELINE("1 - start walking east along the beach,")
  46.  
  47. GFX.WRITELINE("2 - start walking west along the beach,")
  48.  
  49. GFX.WRITELINE("3 - start walking inland, to the north")
  50. KEY.READLINE()
  51. LET i = RETVAL
  52. IF i = 1
  53. {
  54. Option1()
  55. }
  56. IF i = 2
  57. {
  58. Option2()
  59. }
  60. IF i = 3
  61. {
  62. Option3()
  63. }
  64. }
  65. FUNCTION Option1()
  66. {
  67. GFX.CLEAR()
  68. GFX.WRITELINE("You start to walk east along the beach, after what feels")
  69.  
  70. GFX.WRITELINE("like 30 minutes it starts to get dark, which surprises")
  71.  
  72. GFX.WRITELINE("you as you could have sworn it was about midday when you")
  73.  
  74. GFX.WRITELINE("set off. You continue to walk through the night and after")
  75.  
  76. GFX.WRITELINE("what feels like an hour, you see the sun rising,")
  77.  
  78. GFX.WRITELINE("this perplexes you and you almost miss the footsteps")
  79.  
  80. GFX.WRITELINE("in the sand starting after a man sized indentation")
  81.  
  82. GFX.WRITELINE("something clicks in your brain, what is it?")
  83.  
  84. GFX.WRITELINE("1 - someone else must be here, i should follow their tracks")
  85.  
  86. GFX.WRITELINE("2 - Those must be my footsteps, this must be a tiny world")
  87. KEY.READLINE()
  88. LET i = RETVAL
  89. GFX.CLEAR()
  90. IF i = 1
  91. {
  92. Option5()
  93. }
  94. IF i = 2
  95. {
  96. Option6()
  97. }
  98. }
  99. FUNCTION Option2()
  100. {
  101. GFX.CLEAR()
  102. GFX.WRITELINE("You start to walk west along the beach, after what feels")
  103.  
  104. GFX.WRITELINE("like 30 minutes it starts to get dark, which surprises")
  105.  
  106. GFX.WRITELINE("you as you could have sworn it was about midday when you")
  107.  
  108. GFX.WRITELINE("set off. Also, the sun appears to be setting in the east.")
  109.  
  110. GFX.WRITELINE("You continue to walk through the night and after what")
  111.  
  112. GFX.WRITELINE("feels like an hour, you see the sun rising in the west,")
  113.  
  114. GFX.WRITELINE("this perplexes you and you almost miss the footsteps")
  115.  
  116. GFX.WRITELINE("in the sand starting after a man sized indentation")
  117.  
  118. GFX.WRITELINE("something clicks in your brain, what is it?")
  119.  
  120. GFX.WRITELINE("1 - someone else must be here, i should follow their tracks")
  121.  
  122. GFX.WRITELINE("2 - Those must be my footsteps, this must be a tiny world")
  123. KEY.READLINE()
  124. LET i = RETVAL
  125. GFX.CLEAR()
  126. IF i = 1
  127. {
  128. Option5()
  129. }
  130. IF i = 2
  131. {
  132. Option6()
  133. }
  134. }
  135. FUNCTION Option3()
  136. {
  137. GFX.CLEAR()
  138. GFX.WRITELINE("You start to climb the hill and after a few minutes you")
  139.  
  140. GFX.WRITELINE("reach the summit and look down the other side.")
  141.  
  142. GFX.WRITELINE("To your dismay, the other side is just another endless")
  143.  
  144. GFX.WRITELINE("beach, going off in both directions, it appears")
  145.  
  146. GFX.WRITELINE("that you have awoken on a long, thin island.")
  147.  
  148. GFX.WRITELINE("Do you:")
  149.  
  150. GFX.WRITELINE("1 - keep walking along the ridge,")
  151.  
  152. GFX.WRITELINE("2 - return to the beach.(walk along beach before choosing 1)")
  153. KEY.READLINE()
  154. LET i = RETVAL
  155. GFX.CLEAR()
  156. IF i = 1
  157. {
  158. Option4()
  159. }
  160. IF i = 2
  161. {
  162. Scenario1()
  163. }
  164. }
  165. FUNCTION Option4()
  166. {
  167. GFX.WRITELINE("You continue to walk along the ridge, which gets higher")
  168. GFX.WRITELINE("and turns into a mountain, it starts to get dark and")
  169.  
  170. GFX.WRITELINE("you suddenly realise how exhausted you are so you head")
  171.  
  172. GFX.WRITELINE("into a nearby cave and fall asleep.")
  173.  
  174. GFX.WRITELINE("A slithering sound wakes you up and you turn around to see")
  175.  
  176. GFX.WRITELINE("a snail the size of an adolescent bear approaching with")
  177. GFX.WRITELINE("razor sharp teeth ready to chew on your skull.")
  178. GFX.WRITELINE("you see a sharp rock lying on the ground next to you and a")
  179. GFX.WRITELINE("plank of wood on the other side of the cave so you pick them")
  180. GFX.WRITELINE("both up and prepare for battle.")
  181. GFX.WRITELINE("press any key to fight")
  182. KEY.WAIT()
  183. GFX.CLEAR()
  184. LET x = 1
  185. LET h = 5
  186. LET y = 0
  187. Fight()
  188. LET h = h + y
  189. Scenario2()
  190.  
  191. }
  192. FUNCTION Fight()
  193. {
  194. WHILE x > 0
  195. {
  196.  
  197. GFX.WRITELINE("1 - Stab (Stab beats Swing)")
  198. GFX.WRITELINE("2 - Block (Block beats Stab)")
  199. GFX.WRITELINE("3 - Swing (Swing beats Block)")
  200. GFX.WRITELINE("You currently have ")
  201. GFX.WRITE(h)
  202. GFX.WRITE(" health left")
  203. GFX.NEWLINE()
  204. GFX.WRITELINE("The enemy has ")
  205. GFX.WRITE(x)
  206. GFX.WRITE(" health left")
  207. GFX.NEWLINE()
  208. KEY.READLINE()
  209. LET i = RETVAL
  210. UTIL.RANDOM(3)
  211. LET e = RETVAL
  212. IF i = 1
  213. {
  214. IF e = 2
  215. {
  216. Miss()
  217. }
  218. IF e = 3
  219. {
  220. Hit()
  221. }
  222. }
  223. IF i = 2
  224. {
  225. IF e = 1
  226. {
  227. Hit()
  228. }
  229. IF e = 3
  230. {
  231. Miss()
  232. }
  233. }
  234. IF i = 3
  235. {
  236. IF e = 1
  237. {
  238. Miss()
  239. }
  240. IF e = 2
  241. {
  242. Hit()
  243. }
  244. }
  245. IF i = e
  246. {
  247. Tie()
  248. }
  249. GFX.CLEAR()
  250. IF h = 0
  251. {
  252. Death()
  253. }
  254. }
  255. }
  256. FUNCTION Hit()
  257. {
  258. GFX.NEWLINE()
  259. GFX.WRITELINE("You manage to hit the enemy, dealing 1 damage to it")
  260. TIMER.SLEEP(150)
  261. LET x = x - 1
  262. }
  263. FUNCTION Tie()
  264. {
  265. GFX.NEWLINE()
  266. GFX.WRITELINE("You both do the same thing, no damage is dealt")
  267. TIMER.SLEEP(150)
  268. }
  269. FUNCTION Miss()
  270. {
  271. GFX.NEWLINE()
  272. GFX.WRITELINE("The enemy hits you, dealing 1 damage")
  273. TIMER.SLEEP(150)
  274. LET h = h - 1
  275. LET y = y + 1
  276. }
  277. FUNCTION Option5()
  278. {
  279. GFX.WRITELINE("You follow the tracks through the night and what feels like")
  280.  
  281. GFX.WRITELINE("2 hours later you come across the same tracks and man shaped")
  282.  
  283. GFX.WRITELINE("indentation except with more tracks next to it this time.")
  284.  
  285. GFX.WRITELINE("This makes you realise that you are somehow in a tiny world.")
  286. TIMER.SLEEP(300)
  287. GFX.CLEAR()
  288. Option6()
  289. }
  290. FUNCTION Option6()
  291. {
  292. GFX.WRITELINE("After making this realisation, you decide to head north")
  293.  
  294. GFX.WRITELINE("to try and find some way of returning to Earth.")
  295. TIMER.SLEEP(300)
  296. GFX.CLEAR()
  297. Option3()
  298. }
  299. FUNCTION Death()
  300. {
  301. GFX.CLEAR()
  302. GFX.WRITELINE("You have died, your adventure is over.")
  303. GFX.WRITELINE("Press any key")
  304. KEY.WAIT()
  305. GFX.IMAGELOAD("yousrc:game over")
  306. GFX.IMAGEDRAW(RETVAL,0,150)
  307. GFX.SHOW()
  308. }
  309. FUNCTION Scenario2()
  310. {
  311. GFX.WRITELINE("The snail keels over dead and you break off a piece of its")
  312. GFX.WRITELINE("shell, you manage to stick it to your 'shield' using")
  313. GFX.WRITELINE("the slime the snail left in it's trail, making your shield")
  314. GFX.WRITELINE("more durable and giving you more health.")
  315. LET h = 6
  316. GFX.WRITELINE("You poke your head out of the cave to discover that it is")
  317. GFX.WRITELINE("still dusk, then it dawns on you that this Tiny World must")
  318. GFX.WRITELINE("not be moving and that the 'time' of day only changes when")
  319. GFX.WRITELINE("you change your position on the Tiny World.")
  320. GFX.WRITELINE("You search the cave and discover a small crevice right at")
  321. GFX.WRITELINE("the back where you think you can see a dim light glowing.")
  322. GFX.WRITELINE("Press any key to go into the crevice")
  323. KEY.WAIT()
  324. GFX.CLEAR()
  325. Option7()
  326. }
  327. FUNCTION Option7()
  328. {
  329. GFX.WRITELINE("You squeeze through the gap, sucking your stomach in")
  330. GFX.WRITELINE("to avoid getting stuck and emerge out into a small room")
  331. GFX.WRITELINE("containing a large iron chest flanked by two suits of armour")
  332. GFX.WRITELINE("holding lit torches in their hands. You slowly approach with")
  333. GFX.WRITELINE("weapons drawn and when nothing happens you lower your")
  334. GFX.WRITELINE("defenses and stand in front of the chest, you decide to")
  335. GFX.WRITELINE("Open the chest to see what goodies lie inside.")
  336. GFX.WRITELINE("Press any key to open the chest")
  337. KEY.WAIT()
  338. GFX.CLEAR()
  339. Option9()
  340. }
  341. FUNCTION Option8()
  342. {
  343. GFX.WRITELINE("You ascend the mountain and reach the summit within the hour")
  344. GFX.WRITELINE("on closer inspection, it is actually a dormant volcano")
  345. GFX.WRITELINE("rather than a mountain and you can see a tunnel entrance in")
  346. GFX.WRITELINE("the crater, with a ledge spiralling down to it, you start")
  347. GFX.WRITELINE("descending the spiral and when you get near the tunnel")
  348. GFX.WRITELINE("entrance, you notice a gap in the trail that drops into the")
  349. GFX.WRITELINE("lava below. Do you:")
  350. GFX.WRITELINE("1 - Risk jumping the gap")
  351. GFX.WRITELINE("2 - lay your plank of wood across the gap and walk across it")
  352. KEY.READLINE()
  353. LET i = RETVAL
  354. GFX.CLEAR()
  355. IF i = 1
  356. {
  357. Option10()
  358. }
  359. IF i = 2
  360. {
  361. Option11()
  362. }
  363. }
  364. FUNCTION Option9()
  365. {
  366. GFX.WRITELINE("It takes all of your strength to lift the lid and when you")
  367. GFX.WRITELINE("do, you are disappointed to find that all that is in the")
  368. GFX.WRITELINE("chest is a scroll, you open it and it reads:")
  369. GFX.WRITELINE("'HAHAHAHAH!' when you finish reading, more text appears,")
  370. GFX.WRITELINE("as if someone is writing it there and then, it reads:")
  371. GFX.WRITELINE("'I trapped you hear on this Tiny World and the only way back")
  372. GFX.WRITELINE("to Earth is through the portal in my study, deep inside the")
  373. GFX.WRITELINE("planet, be warned, there are many traps and tests you must")
  374. GFX.WRITELINE("overcome to reach me.' When you finished reading it")
  375. GFX.WRITELINE("it becomes apparent that your captor is finished and that")
  376. GFX.WRITELINE("you should return to the mountainside. As you turn around")
  377. GFX.WRITELINE("you hear two thuds and realise that the suits of armour have")
  378. GFX.WRITELINE("become animated and have blocked your escape. You attempt to")
  379. GFX.WRITELINE("hit one of them but your weapons do nothing against their")
  380. GFX.WRITELINE("armour. The other one swings at you his torch and you try to")
  381. GFX.WRITELINE("deflect it with your stone. The torch's head snaps off and")
  382. GFX.WRITELINE("falls into a nearby puddle, which puts it out. As soon as")
  383. GFX.WRITELINE("the flame is distinguished, the suit of amour falls to the")
  384. GFX.WRITELINE("ground and clatters everywhere, knocking both you, and the")
  385. GFX.WRITELINE("other suit of armour over, fortunately, the flame from the")
  386. GFX.WRITELINE("other suit of armour lands in the puddle and is also")
  387. GFX.WRITELINE("distinguished, removing the life force from the suit of")
  388. GFX.WRITELINE("armour. You try on some of the armour but the only thing")
  389. GFX.WRITELINE("that fits is a helmet, giving you more health.")
  390. LET h = h + 2
  391. GFX.WRITELINE("press any key to return to the mountainside")
  392. KEY.WAIT()
  393. GFX.CLEAR()
  394. Option8()
  395. }
  396. FUNCTION Option11()
  397. {
  398. GFX.WRITELINE("You lay your plank of wood across and gap and start to cross")
  399. GFX.WRITELINE("Halfway there, you hear a crack and the plank falls away")
  400. GFX.WRITELINE("beneath you and you fall as well, you grab onto the nearest")
  401. GFX.WRITELINE("thing. Is it:")
  402. GFX.WRITELINE("1 - a gutting out rock")
  403. GFX.WRITELINE("2 - a plant root")
  404. KEY.READLINE()
  405. LET i = RETVAL
  406. GFX.CLEAR()
  407. IF i = 1
  408. {
  409. GFX.WRITELINE("You grab onto the rock but it was loose and you plummet")
  410. GFX.WRITELINE("to your death into the lava below, screaming as you do so.")
  411. TIMER.SLEEP(500)
  412. Death()
  413. }
  414. IF i = 2
  415. {
  416. GFX.WRITELINE("You grab onto the plant root and fortunately it takes your")
  417. GFX.WRITELINE("weight and you pull yourself up, unfortunately, you now have")
  418. GFX.WRITELINE("one less health due to the loss of your shield.")
  419. LET h = h - 1
  420. Option12()
  421. }
  422. }
  423. FUNCTION Option12()
  424. {
  425. GFX.WRITELINE("Once on the other side, you enter the tunnel which")
  426. GFX.WRITELINE("immediatley expands into a large cave containing 2 more")
  427. GFX.WRITELINE("Giant snails, the first one sees you and attacks.")
  428. GFX.WRITELINE("Press any key to fight")
  429. KEY.WAIT()
  430. LET x = 1
  431. LET y = 0
  432. Fight()
  433. GFX.WRITELINE("You kill the first snail but the other sees you and")
  434. GFX.WRITELINE("attacks before you have time to heal.")
  435. GFX.WRITELINE("Press any key to fight")
  436. KEY.WAIT()
  437. LET x = 1
  438. Fight()
  439. LET h = h + y
  440. GFX.WRITELINE("Once both snails are dead, you crack their shells combine")
  441. GFX.WRITELINE("bits of them with your rock to create a makeshift")
  442. GFX.WRITELINE("sword, which lowers the amount of health enemies have.")
  443. GFX.WRITELINE("You continue on into another tunnel until you come to a")
  444. GFX.WRITELINE("large iron door with a very large bear guarding it")
  445. GFX.WRITELINE("Press any key to fight")
  446. KEY.WAIT()
  447. LET x = 3
  448. Fight()
  449. LET h = h + y
  450. LET h = h + 2
  451. LET z = 0
  452. LET w = 0
  453. GFX.WRITELINE("The bear collapses and you skin it, making a better shield")
  454. GFX.WRITELINE("you also remove its teeth, you can either:")
  455. GFX.WRITELINE("1 - attach them to your 'sword' so that enemies have less HP")
  456. GFX.WRITELINE("2 - attach them to your shield so that you have more HP")
  457. KEY.READLINE()
  458. LET i = RETVAL
  459. GFX.CLEAR()
  460. IF i = 1
  461. {
  462. Option13()
  463. }
  464. IF i = 2
  465. {
  466. Option14()
  467. }
  468. }
  469.  
  470. FUNCTION Option10()
  471. {
  472. GFX.WRITELINE("You take a run up and jump higher and further than ever")
  473. GFX.WRITELINE("before in your life, easily clearing the gap.")
  474. Option12()
  475. }
  476. FUNCTION Option13()
  477. {
  478. LET w = w + 1
  479. Scenario3()
  480. }
  481. FUNCTION Option14()
  482. {
  483. LET z = z + 1
  484. Scenario3()
  485. }
  486. FUNCTION Scenario3()
  487. {
  488. GFX.WRITELINE("You have open the iron doors and enter a very fancy looking")
  489. GFX.WRITELINE("room. 'I've been expecting you' comes a weary voice from")
  490. GFX.WRITELINE("across the room, a large chair swivels around to reveal an")
  491. GFX.WRITELINE("old, shrivelled up man with a very long beard.")
  492. GFX.WRITELINE("'Let me out of here' you yell, 'not until you defeat me' he")
  493. GFX.WRITELINE("replies. The old man then jumps out of his chair like a")
  494. GFX.WRITELINE("ninja and takes stance infront of you.")
  495. GFX.WRITELINE("Press any key to fight")
  496. KEY.WAIT()
  497. LET x = 6 - w
  498. LET h = h + z
  499. Fight()
  500. GFX.WRITELINE("The old man's corspe is blasted back onto his chair, which")
  501. GFX.WRITELINE("topples over onto a very suspicious looking, large, red")
  502. GFX.WRITELINE("button. 'SELF DESTRUCT SEQUENCE INITIATED, SELF DESTRUCT IN")
  503. GFX.WRITELINE("T MINUS 30 SECONDS' a loud, robotic voice says.")
  504. GFX.WRITELINE("You look over to your left, to see a whirling portal at the")
  505. GFX.WRITELINE("end of the room, however, there is a large lava pit between")
  506. GFX.WRITELINE("you and the portal with three rope swings to choose from:")
  507. GFX.WRITELINE("1 - swing on the left one")
  508. GFX.WRITELINE("2 - swing on the centre one")
  509. GFX.WRITELINE("3 - swing on the right one")
  510. KEY.READLINE()
  511. LET i = RETVAL
  512. GFX.CLEAR()
  513. IF i = 1
  514. {
  515. Option15()
  516. }
  517. IF i = 2
  518. {
  519. Option16()
  520. }
  521. IF i = 3
  522. {
  523. Option15()
  524. }
  525. }
  526. FUNCTION Option16()
  527. {
  528. GFX.WRITELINE("You grab the middle rope and swing across, you hear a creak")
  529. GFX.WRITELINE("and suddenly the rope snaps, plunging you into the deadly")
  530. GFX.WRITELINE("lava below, your screams are cut short, so close, yet so far")
  531. TIMER.SLEEP(500)
  532. Death()
  533. }
  534. FUNCTION Option15()
  535. {
  536. GFX.WRITELINE("You grab the rope and swing across, safely landing on the")
  537. GFX.WRITELINE("other side, you dive into the portal just as you hear:")
  538. GFX.WRITELINE("'SELF DESTRUCT IN T MINUS 5 4 3 2-'.")
  539. GFX.WRITELINE("Press any key to continue")
  540. KEY.WAIT()
  541. GFX.CLEAR()
  542. End()
  543. }
  544. FUNCTION End()
  545. {
  546. GFX.WRITELINE("You wake up on a deserted beach, absolutely soaked and")
  547. GFX.WRITELINE("coughing up sea water.")
  548. GFX.WRITELINE("The last thing you remember is flying through the Bermuda")
  549. GFX.WRITELINE("Triangle, when suddenly everything stopped working and")
  550. GFX.WRITELINE("you plunged into the depths of the Atlantic ocean.")
  551. GFX.WRITELINE("press any key to continue...")
  552. KEY.WAIT()
  553. GFX.CLEAR()
  554. GFX.IMAGELOAD("yousrc:game over")
  555. LET i = RETVAL
  556. GFX.IMAGEDRAW(i,0,150)
  557. GFX.SHOW()
  558. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement