home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 4 / AUCD4.iso / acornuser / 1998 / aug1998 / freeware / PD / IntFiction / DavidRPG2 / Example < prev   
Text File  |  1998-03-26  |  2KB  |  141 lines

  1. | Example Game
  2. | David Spence, 1998.
  3. | For DavidRPG2 the adventure interpreter.
  4.  
  5. name=Example
  6. adventure=To test this
  7. author=David Spence, 1998
  8. version=0.01 (13 Mar 1998)
  9.  
  10. | Begin Rooms
  11.  
  12. | all rooms must have name and text1 and can have up to 20 lines of text
  13.  
  14. variable o = 0
  15. variable jj = 0
  16.  
  17. room one start {
  18. name:    "Room one"
  19. text:    "This is the first room."
  20.          "It is cold and damp."
  21. east:    goto(two)
  22. north:   goto(three)
  23. objects: bat,box
  24. actions: {
  25. "shout": print("Keep your voice down.\n")
  26. }
  27. }
  28.  
  29. room onea {
  30. name:    "Special Room"
  31. text:    "This is the secret room."
  32.          "Jump to leave."
  33. east:    {
  34.          change(o,1)
  35.          print("Print you have typed east ")
  36.          print(o)
  37.          print(" times.\n")
  38.          }
  39. north:   set(o,0)
  40. actions: {
  41. "jump": {
  42. print("You leave the room for good?")
  43. goto(one)
  44. }
  45. }
  46. }
  47.  
  48.  
  49. room two {
  50. name:    "Room two"
  51. text:    "This is the second room."
  52. west:    goto(one)
  53. north:   goto(three)
  54. }                   
  55.  
  56. room three {
  57. name:    "Room three"
  58. text:    "This is the third room."
  59.          "It is warm and damp."
  60.          "You feel like you are being watched."
  61. south:   goto(one)
  62. north:   goto(two)
  63. people:  old_man
  64. }                   
  65.  
  66. | next the objects 
  67.            
  68. | objects need move:, name:, text1:
  69.  
  70. object box {
  71. move:   no           
  72. | -1 is infinite 
  73. energy: 2
  74. dead:   { 
  75. print("The box is destroyed.\n")
  76. O_move(box,null)
  77. print("You are teleported to a special room\n")
  78. goto(onea)
  79. set(jj,1)
  80. }
  81. name:   "Box"
  82. text:   "It is very large and cannot be moved."
  83. canbe: {
  84. "hit": {
  85. print("The box is crushed.\n")
  86. change(energy,-1)
  87. }
  88. }
  89. }
  90.  
  91. object bat {
  92. move:   yes          
  93. | -1 is infinite 
  94. energy: -1     
  95. name:   "Bat"
  96. text:   "It is a large baseball bat."
  97. cando: {
  98.  "hit":    {
  99.  print("You hit it with the bat")
  100.  }
  101. }
  102. }
  103.  
  104. | finally the people
  105.  
  106. person old_man {
  107. name: "Old Man"
  108. text:  "He is old and looks wise."
  109. move: no
  110. energy: -1
  111. see:    print("The old man says hello\n")
  112. unsee:  print("The old man says goodbye.") 
  113.  canbe: {
  114.   "hit": { 
  115.    print("The Old man is invincible.\n")
  116.   }
  117.  }
  118. talk: {
  119.  "help":{
  120.  print("I am imaginary, I cannot help you.\n") 
  121.  }
  122. }
  123. }
  124.  
  125. | the player
  126.  
  127. player {
  128. name: "A. N. Explorer"
  129. text: "Your not a very interesting person."
  130. energy: -1
  131. cando: {
  132. "unjump": {
  133. if(jj = "1") {
  134. if(c_room <> "Special Room") {
  135. goto(onea)
  136. print("Well Done. You are moved back to the secret room.")
  137. }
  138. }
  139. }
  140. }
  141. }