Prithak

Mysterious Forest Green (Don't even try to run)

Mar 27th, 2018
791
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Mysterious Forest GREEN!!
  2. 'Coded by the company Prism Codes
  3. 'Graphics Designs: G A F A C Q B (Graphical Association for Automated Coding QBASIC)
  4. 'DOSBOX/Android Edition
  5. '------------------------------CREDITS IN THE GAME!!!--------------------------
  6.  
  7. 'Declaring the subs
  8. DECLARE SUB makechar(x,y)
  9. DECLARE SUB makebeast(x,y)
  10. DECLARE SUB move(x,y)
  11. DECLARE SUB loadgame(x,y,lvl)
  12. DECLARE SUB savegame(x,y,lvl)
  13. 'Some Optimization
  14. SCREEN 13
  15. COLOR 2
  16. COLOR , 15
  17. CLS
  18. 'intro
  19.  
  20. GOTO mainmenu
  21. A$ = "Coded by Prithak GAMES!!!"
  22. FOR i = 1 TO LEN(A$)
  23.     DELAY .1
  24.     LOCATE 20, 10: PRINT LEFT$(A$, i)
  25. NEXT i
  26. B$ = "Programmed on QBASIC"
  27. FOR i = 1 TO LEN(B$)
  28.     DELAY .1
  29.     LOCATE 21, 10: PRINT LEFT$(B$, i)
  30. NEXT i
  31. DELAY 2
  32. 'Here will take place the main menu of the game!
  33. mainmenu:
  34. CLS
  35. COLOR 2
  36. PRINT STRING$(40, "-")
  37. PRINT "Welcome to MYSTERIOUS FOREST GREEN!"
  38. PRINT STRING$(40, "-")
  39. 'Here is the choices you can take!
  40. PRINT "Press [A] For New Game."
  41. PRINT "Press [B] To Settings."
  42. PRINT "Press [C] To Load Saved Game!"
  43. PRINT "Press [D] FOR Credits!"
  44. PRINT "Press [E] TO END the game!"
  45. PRINT STRING$(40, "-")
  46. DO
  47.     K$ = UCASE$(INKEY$)
  48.     IF K$ = "A" THEN GOTO game
  49.     IF K$ = "B" THEN GOTO settings
  50.     IF K$ = "C" THEN GOTO loadgame
  51.     IF K$ = "D" THEN GOTO credits
  52.     IF K$ = "E" THEN END
  53. LOOP
  54. settings:
  55. 'Noting to do in this settings yet!
  56. CLS
  57. PRINT "No settings in this game :P"
  58. PRINT "Press ANY KEY TO continue"
  59. SLEEP
  60. GOTO mainmenu
  61.  
  62. loadgame:
  63. 'The loading of the game!
  64. CLS
  65. PRINT "Beggining the process of loading..."
  66. PRINT "Started..."
  67. PRINT "Getting Information..."
  68. CALL loadgame(x, y, lvl)
  69. PRINT "Getting TO the save area!"
  70. IF lvl = 1 THEN GOTO lvl1
  71. IF lvl = 2 THEN GOTO lvl2
  72. IF lvl = 3 THEN GOTO lvl3
  73.  
  74. game:
  75. 'Determining X and Y
  76. x = 115
  77. y = 120
  78. ' Professor Talking!
  79. CLS
  80. PRINT "Professor: Hello, I am the professor here! (Any key to continue!)"
  81. SLEEP
  82. PRINT "Professor: I guess you are new here!"
  83. SLEEP
  84. PRINT "Professor: Anyways, Can I get your name?"
  85. LINE INPUT "Enter your name"; n$
  86. PRINT "Professor: Ah! You are that "; n$; " moving here right?"
  87. SLEEP
  88. PRINT "Professor: Well! Faroma Town is really a place to stay!"
  89. SLEEP
  90. PRINT "Professor: Enough of me blabbering and get here safely and meet me as fast as you can!"
  91. SLEEP
  92. PRINT "Then you get out of the truck you were travelling from and look around."
  93. SLEEP
  94. lvl1:
  95. lvl = 1
  96. COLOR , 11
  97. COLOR 0
  98. CLS
  99. DO
  100.  
  101.     move x, y
  102.     makechar x, y
  103.     K$ = UCASE$(INKEY$)
  104.     '---------Drawing Area------------
  105.     LINE (10, 10)-(100, 80), 2, BF
  106.     LINE (80, 100)-(100, 110), 6, BF
  107.     LINE (80, 100)-(100, 110), 0, B
  108.     LINE (10, 10)-(100, 80), 0, B
  109.     LINE (200, 10)-(300, 80), 1, BF
  110.     LINE (200, 10)-(300, 80), 0, B
  111.     LINE (280, 90)-(300, 100), 6, BF
  112.     LINE (280, 90)-(300, 100), 0, B
  113.     LINE (120, 100)-(180, 150), 7, BF
  114.     LINE (120, 100)-(180, 150), 0, B
  115.     LINE (40, 80)-(40, 100), 0
  116.     LINE (60, 80)-(60, 100), 0
  117.     LINE (240, 80)-(240, 100), 0
  118.     LINE (260, 80)-(260, 100), 0
  119.     '----------------------------------
  120.  
  121.     '----------------------Detecting----------------------
  122.     IF x >= 70 AND y >= 90 AND x <= 100 AND y <= 110 THEN
  123.         messagebox "Your House"
  124.         COLOR , 11
  125.     END IF
  126.     IF x >= 270 AND y >= 80 AND x <= 300 AND y <= 100 THEN
  127.         messagebox "Professor's house!"
  128.         COLOR , 11
  129.     END IF
  130.     IF x >= 240 AND y >= 80 AND x <= 250 AND y <= 90 THEN
  131.         GOTO phouse
  132.     END IF
  133.     IF x >= 40 AND y >= 80 AND x <= 50 AND y <= 90 THEN
  134.         GOTO yhouse
  135.     END IF
  136.     '------------------------------------------------------
  137.  
  138.     'Only for development work, Detection of coordinates!
  139.     LOCATE 1, 1: PRINT x; y
  140.     'Displaying and clearing screen!
  141.  
  142.  
  143. LOOP
  144.  
  145. phouse:
  146. GOTO lvl1
  147. yhouse:
  148. GOTO lvl1
  149.  
  150. lvl2:
  151. lvl = 2
  152.  
  153. lvl3:
  154. lvl = 3
  155.  
  156. credits:
  157. CLS
  158. PRINT "Made by: Prithak Games!"
  159. PRINT "Graphics Degins by G A F A C Q B (Graphical Association for Automated Coding QBASIC"
  160. PRINT "Press any key to go back to menu"
  161. GOTO mainmenu
  162. SUB makechar (x, y)
  163.     X2 = x + 10
  164.     Y2 = y + 10
  165.     LINE (x, y)-(X2, Y2), 2, BF
  166.     LINE (x, y)-(X2, Y2), 0, B
  167. END SUB
  168. SUB move (x, y)
  169.     k$ = UCASE$(INKEY$)
  170.     IF k$ = "W" THEN y = y - 5: CLS
  171.     IF k$ = "S" THEN y = y + 5: CLS
  172.     IF k$ = "A" THEN x = x - 5: CLS
  173.     IF k$ = "D" THEN x = x + 5: CLS
  174.     IF k$ = CHR$(23) THEN y = y - 10: CLS
  175.     IF k$ = CHR$(19) THEN y = y + 10: CLS
  176.     IF k$ = CHR$(1) THEN x = x - 10: CLS
  177.     IF k$ = CHR$(4) THEN x = x + 10: CLS
  178.     IF k$ = "J" THEN savegame x, y, lvl
  179. END SUB
  180. SUB loadgame (x, y, lvl)
  181.     OPEN "mysave.dat" FOR INPUT AS #1
  182.     INPUT #1, x
  183.     INPUT #1, y
  184.     INPUT #1, lvl
  185.     CLOSE #1
  186.     EXIT SUB
  187. END SUB
  188. SUB savegame (x, y, lvl)
  189.     CLS
  190.     PRINT "Saving Game.. .This may take several milliseconds."
  191.     OPEN "mysave.dat" FOR OUTPUT AS #1
  192.     PRINT #1, x
  193.     PRINT #1, y
  194.     PRINT #1, lvl
  195.     CLOSE #1
  196.     INPUT "DO you want TO keep ON playing(Y) OR EXIT the game(N)?"; ch$
  197.     ch$ = UCASE$(ch$)
  198.     IF ch$ = "Y" THEN EXIT SUB
  199.     IF ch$ = "N" THEN SYSTEM
  200. END SUB
  201.  
  202. SUB messagebox (word$)
  203.     LINE (10, 150)-(200, 200), 6, BF
  204.     LINE (10, 150)-(200, 200), 0, B
  205.     COLOR , 6: LOCATE 23, 3: PRINT word$
  206. END SUB
  207.  
  208. SUB DELAY (dlay!)
  209.     start! = TIMER
  210.     DO WHILE start! + dlay! >= TIMER
  211.         IF start! > TIMER THEN start! = start! - 86400
  212.     LOOP
  213. END SUB
RAW Paste Data