Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.25 KB | None | 0 0
  1. `*****************************************
  2. `*****************************************
  3. `***
  4. `*** TITLE - Game Template
  5. `*** VERSION - 1.0.0b LAST UPDATED - 3.8.2016
  6. `*** DEVELOPER - Jason Holm
  7. `*** COPYRIGHT - Ingenious Student Labs
  8. `*** DATE CREATED - 1.1.2005
  9. `*** EDITED BY Kealan Johnson
  10. `*** EDITING DATE - 5/8/19
  11. ` ***
  12. ` *** START SYSTEM SETUP SECTION
  13. ` ***
  14. sync on
  15. sync rate 30
  16. autocam off
  17. hide mouse
  18. randomize timer()
  19. ` ***
  20. ` *** STOP SYSTEM SETUP SECTION
  21. ` ***
  22. ` ***************************************
  23. ` ***
  24. ` *** START INTRO SECTION
  25. ` ***
  26. ` ***
  27. ` *** INTRO SECTION HEADER
  28. ` ***
  29. `DECLARE VARIABLES
  30. `SCREEN DISPLAY
  31. cls RGB (200, 90, 0)
  32. ink rgb (125, 0, 125),0
  33. center text 320,220,"PHASE 4 TEASER"
  34. center text 320,260,"HIT ANY KEY TO BEGIN"
  35. `LOAD SOUNDS
  36. `SOUND EFFECTS
  37. `SPECIAL EFFECTS
  38. `REFRESH SCREEN
  39. sync
  40. ` ***
  41. ` *** INTRO SECTION LOOP
  42. ` ***
  43. do
  44. `SCREEN DISPLAY
  45. `CONTROL INPUT
  46. if keystate( scancode() ) = 1 then goto OptionsSection
  47. `REFRESH SCREEN
  48. sync
  49. loop
  50. ` ***
  51. ` *** END INTRO SECTION
  52. ` ***
  53. ` *****************************************
  54. ` ***
  55. ` *** START OPTIONS SECTION
  56. ` ***
  57. ` ***
  58. ` *** OPTIONS SECTION HEADER
  59. ` ***
  60. OptionsSection:
  61. `DECLARE VARIABLES
  62. `Levels
  63. TotalLevels = 1 : `Total number of levels
  64. LevelNumber = 1 : `Start on Level 1
  65. `SCREEN DISPLAY
  66. cls RGB (0, 180, 100)
  67. ink rgb(0, 50, 0),0
  68. center text 320,220,"PRESS E FOR ABOVE THE MAP VIEW, OR PRESS F FOR THIRD PERSON VIEW"
  69. center text 320,260,"HIT ANY KEY TO BEGIN"
  70. `LOAD SOUNDS
  71. `SOUND EFFECTS
  72. `SPECIAL EFFECTS
  73. `REFRESH SCREEN
  74. sync
  75. ` ***
  76. ` *** OPTIONS SECTION LOOP
  77. ` ***
  78. do
  79. if scancode() = 0 then exit
  80. loop
  81. do
  82. `SCREEN DISPLAY
  83. `CONTROL INPUT
  84. if Keystate(scancode())=1 then goto LevelIntroSection
  85. `REFRESH SCREEN
  86. sync
  87. loop
  88. ` ***
  89. ` *** END OPTIONS SECTION
  90. ` ***
  91. ` *****************************************
  92. ` ***
  93. ` *** START LEVEL INTRO SECTION
  94. ` ***
  95. ` ***
  96. ` *** OPTIONS SECTION HEADER
  97. ` ***
  98. LevelIntroSection:
  99. `DECLARE VARIABLES
  100. `SCREEN DISPLAY
  101. cls RGB(125, 0, 255)
  102. ink rgb(15, 0, 0),0
  103. Set Text size 30
  104. center text 310,220, "LEVEL"
  105. set cursor 355,220
  106. print LevelNumber
  107. Set Text size 10
  108. center text 320,245, "HIT ANY KEY TO BEGIN"
  109. `LOAD SOUNDS
  110. Load sound "Sounds/bite.wav", 1
  111. Load music "Music/music.mp3", 2
  112. Set music volume 2, 100
  113. Loop music 2
  114. `SOUND EFFECTS
  115. `SPECIAL EFFECTS
  116. `REFRESH SCREEN
  117. sync
  118. ` ***
  119. ` *** OPTIONS SECTION LOOP
  120. ` ***
  121. do
  122. if scancode() = 0 then exit
  123. loop
  124. do
  125. `SCREEN DISPLAY
  126. `CONTROL INPUT
  127. if keystate( scancode() ) = 1 then goto MainSection
  128. `REFRESH SCREEN
  129. sync
  130. loop
  131. ` ***
  132. ` *** END LEVEL INTRO SECTION
  133. ` ***
  134. ` *****************************************
  135. ` ***
  136. ` *** START MAIN SECTION
  137. ` ***
  138. ` ***
  139. ` *** MAIN SECTION HEADER
  140. ` ***
  141. MainSection:
  142. `DECLARE VARIABLES
  143. `Player Character
  144. MyTimer = 1500 : rem MyTimer / sync rate = seconds on timer (approx.)
  145. Gravity# = 1 : rem How powerful gravity is
  146. MyPower = 10 : rem How strong the player can jump
  147. MySpeed = 9 : rem How fast the player can run
  148. `Projectiles
  149. `Enemies
  150. `Other
  151. `Score
  152. MyScore = 0
  153. MyAcceleration# = 0.0 : rem Start without jumping or falling
  154. REM Make Light
  155. Make Light 25
  156. Set Light Range 25, 10000
  157. Position Light 25, 0,100,0
  158. Point Light 25, 0,0,0
  159.  
  160. Make Light 26
  161. Set Light Range 26, 10000
  162. Position Light 26, 0,100,0
  163. Point Light 26, 0,20,0
  164. `LOAD IMAGES
  165. Load Image "Images/texture 18.jpg", 1
  166. Load Image "Images/sky.bmp",2
  167. Load Image "Images/rocky05.bmp",3
  168. Load Image "Images/walls/cave02.bmp",4
  169. Load Image "Images/exterior/window01.bmp",5
  170. Load Image "Images/grassy01.bmp",6
  171. Load Image "Images/green/bark07", 7
  172. Load Image "Images/leaves.jpg", 8
  173. Load Image "Images/watermelon.jpg", 9
  174. Load Image "Images/lemon.jpg", 10
  175. Load Image "Images/lime.jpg", 11
  176. Load Image "Images/strawberry.jpg", 12
  177. `SCREEN DISPLAY
  178. cls 0
  179.  
  180. backdrop on
  181. `TEXT
  182. `HEADS-UP DISPLAY (HUD)
  183. `OBJECT CREATION
  184. `World Map
  185. `Player Character
  186. make object cone 1, 50 :
  187. Texture object 1, 1
  188. position object 1, 0, 25, 0
  189. Scale object 1, 150, 500, 100
  190. REM North Wall - Light Blue
  191. make Object Box 2, 3000,1000,10 :
  192. Texture object 2, 2
  193. position Object 2, 0,500,1500
  194.  
  195. REM East Wall - Light Red
  196. make Object Box 3, 3000,1000,10 :
  197. Texture object 3, 3
  198. rotate Object 3, 0,90,0
  199. position Object 3, 1500,500,0
  200.  
  201.  
  202. REM West Wall - Yellow Orange
  203. make Object Box 4, 3000,1000,10 :
  204. Texture object 4, 4
  205. rotate Object 4,0,90,0
  206. position Object 4, -1500,500,0
  207.  
  208. REM South Wall - Blue Green
  209. make Object Box 5, 3000,1000,10 :
  210. Texture object 5, 5
  211. position Object 5, 0,500,-1500
  212.  
  213. REM Floor - Green
  214. make Object Plain 6, 3000,3000,10 :
  215. Texture object 6, 6
  216. position Object 6, 0,0,0
  217. rotate Object 6, 90,0,0
  218.  
  219. REM Tree 1
  220. make Object Cylinder 7, 75 :
  221. Texture object 7, 7
  222. position Object 7, 0,10,-300
  223. scale Object 7, 10,250,10
  224. REM Tree 2
  225. make Object Cylinder 8, 75 :
  226. Texture object 8, 7
  227. position Object 8, 300,10,0
  228. scale Object 8, 10,250,10
  229. REM Tree 3
  230. make Object Cylinder 9, 75 :
  231. Texture object 9, 7
  232. position Object 9, 600,10,0
  233. scale Object 9, 10,250,10
  234.  
  235. REM Tree 4
  236. make Object Cylinder 10, 75 :
  237. Texture object 10, 7
  238. position Object 10, -300,10,0
  239. scale Object 10, 10,250,10
  240. REM Tree 5
  241. make Object Cylinder 11, 75 :
  242. Texture object 11, 7
  243. position Object 11, -600,10,0
  244. scale Object 11, 10,250,10
  245. REM Tree 6
  246. make Object Cylinder 12, 75 :
  247. Texture object 12, 7
  248. position Object 12, 0,10,300
  249. scale Object 12, 10,250,10
  250.  
  251. REM Leaves 1
  252. make Object Cone 13, 100 :
  253. Texture object 13, 8
  254. position Object 13, 300,125,0
  255. scale Object 13, 75,75,75
  256.  
  257. REM Leaves 2
  258. make Object Cone 14, 100 :
  259. Texture object 14, 8
  260. position Object 14, 600,125,0
  261. scale Object 14, 75,75,75
  262.  
  263. REM Leaves 3
  264. make Object Cone 15, 100 :
  265. Texture object 15, 8
  266. position Object 15, -300,125,0
  267. scale Object 15, 75,75,75
  268.  
  269. REM Leaves 4
  270. make Object Cone 16, 100 :
  271. Texture object 16, 8
  272. position Object 16, -600,125,0
  273. scale Object 16, 75,75,75
  274.  
  275. REM Leaves 5
  276. make Object Cone 17, 100 :
  277. Texture object 17, 8
  278. position Object 17, 0,125,300
  279. scale Object 17, 75,75,75
  280.  
  281. REM Leaves 6
  282. make Object Cone 18, 100 :
  283. Texture object 18, 8
  284. position Object 18, 0,125,-300
  285. scale Object 18, 75,75,75
  286. NumberOfSpheres=100 : NS = NumberOfSpheres + 19
  287. for x=19 to NS : Rem Cones
  288. make object sphere x, rnd(50)+50
  289. fruit = rnd(3)+9
  290. texture object x, fruit
  291. do
  292. NoCenterX = rnd(2000)-1000
  293. NoCenterZ = rnd(2000)-1000
  294. if (NoCenterX > -150 and NoCenterX < 150 and NoCenterZ > -150 and NoCenterZ < 150) = 0 then exit
  295. if (NoCenterX > -150 and NoCenterX < 150 and NoCenterZ > -150 and NoCenterZ < 150) = 0 and NoCenterZ > 150 then exit
  296. loop
  297. position object x, NoCenterX,object size(x)*.75,NoCenterZ
  298. next x
  299.  
  300. `Enemies
  301. `Pick-Ups
  302. `LOAD MODELS
  303. `SET LIGHTS
  304. `SET CAMERA
  305. followMe = 1 :
  306. `SOUND EFFECTS
  307. `SPECIAL EFFECTS
  308. `REFRESH SCREEN
  309. sync
  310. ` ***
  311. ` *** MAIN SECTION LOOP
  312. ` ***
  313. do
  314. if scancode() = 0 then exit
  315. loop
  316. do
  317. `SPECIAL EFFECTS
  318. REM OBJECT ORIENTATIONS
  319. P1X# = object position X(1)
  320. P1Y# = object position Y(1)
  321. P1Z# = object position Z(1)
  322. A1X = object angle X(1)
  323. A1Y = object angle Y(1)
  324. A1Z = object angle Z(1)
  325. REM CAMERA ORIENTATIONS
  326. Rem Store the positions of the Camera as variables
  327. cpX# = camera position X()
  328. cpY# = camera position Y()
  329. cpZ# = camera position Z()
  330. Rem Store the angles of the Camera as variables
  331. caX# = camera angle X()
  332. caY# = camera angle Y()
  333. caZ# = camera angle Z()
  334. `OBJECT ORIENTATIONS (Pre-Movement, Pre-Collision)
  335. `Player Character
  336. P1X# = object position X(1)
  337. P1Y# = object position Y(1)
  338. P1Z# = object position Z(1)
  339. A1X = object angle X(1)
  340. A1Y = object angle Y(1)
  341. A1Z = object angle Z(1)
  342. `Projectiles
  343. `Enemies
  344. `LIVE SCREEN DISPLAY
  345. `TEXT
  346. Set cursor 10, 10
  347. Print " Score: ", MyScore
  348. set text size 10
  349. center text 320, 430, "PRESS E FOR ABOVE THE MAP VIEW, OR PRESS F FOR THIRD PERSON VIEW"
  350. center text 320,440,"USE ARROW KEYS OR WASD TO MOVE | PRESS 'Q' TO QUIT"
  351. `HUD
  352. `CONTROL INPUT
  353. `Acceleration and Pitch
  354. if Upkey()=1 or keystate(17)=1 then move object 1,10
  355. if Downkey()=1 or keystate(31)=1 then move object 1,-10
  356.  
  357. `Turning and Banking
  358. if Leftkey()=1 or keystate(30)=1 then Yrotate object 1,wrapvalue(A1Y-5)
  359. if Rightkey()=1 or keystate(32)=1 then Yrotate object 1,wrapvalue(A1Y+5)
  360. `Releasing Projectiles
  361. `Quit Game
  362. if Inkey$() = "q"
  363. for x = 1 to 100 REM to highest object number
  364. if object exist (x) = 1 then delete object x
  365. if light exist (x) = 1 then delete object x
  366. next x
  367. backdrop off
  368. goto EndSection
  369. endif
  370. `Camera Control
  371. if Inkey$()="e"
  372. position camera 0,1500,0 : Rem Set camera position
  373. point camera 0,0,0 : Rem Rotate camera to point at a specific place
  374. followMe = 0 : Rem Tell the program not to follow Object 1
  375. endif
  376.  
  377. if Inkey$()="f"
  378. followMe = 1 : Rem Tell the program to follow Object 1
  379. endif
  380. `TRANSFORM OBJECTS
  381. `MOVE OBJECTS
  382. `Player Character
  383. `Projectiles
  384. `Enemies
  385. `OBJECT ORIENTATIONS (Post-Movement, Pre-Collision)
  386. `Player Character
  387. newP1X# = object position X(1)
  388. newP1Y# = object position Y(1)
  389. newP1Z# = object position Z(1)
  390. newA1X = object angle X(1)
  391. newA1Y = object angle Y(1)
  392. newA1Z = object angle Z(1)
  393. `Projectiles
  394. `Enemies
  395. `CHECK COLLISIONS
  396. `Player Character
  397. `Walls
  398. for t = 7 to 18
  399. if object collision (1, t)> 0 then
  400. position object 1, P1X#, P1Y#, P1Z#
  401. next t
  402. for w = 2 to 5
  403. if object collision (1, w)> 0 then
  404. position object 1, P1X#, P1Y#, P1Z#
  405. next w
  406.  
  407. `Pick-Ups
  408. for p = 19 to 119
  409. if object collision (1,p) >0
  410. set sound volume 1, 100
  411. play sound 1
  412. MyScore = Myscore + 100
  413. exclude object on p
  414. endif
  415. next p
  416. `Enemies
  417. `Projectiles
  418. `Walls
  419. `Enemies
  420. `Enemies
  421. `Walls
  422. `OBJECT ORIENTATIONS (Post-Movement, Post-Collision)
  423. `Player Character
  424. P1X# = object position X(1)
  425. P1Y# = object position Y(1)
  426. P1Z# = object position Z(1)
  427. A1X = object angle X(1)
  428. A1Y = object angle Y(1)
  429. A1Z = object angle Z(1)
  430. `Projectiles
  431. `Enemies
  432. `CHECK PLAYER EXPIRATION
  433. `MOVE CAMERA
  434. if followMe = 1 : Rem If the camera is following Object 1
  435. cpZ# = Newzvalue(P1Z#,A1Y-180,200) : Rem Calculate the camera's new Z position
  436. cpX# = Newxvalue(P1X#,A1Y-180,200) : Rem Calculate the camera's new X position
  437. Position camera cpX#,300,cpZ# : Rem Set the camera placement
  438. Point camera P1X#,P1Y#+200,P1Z# : Rem Point camera at the top of Object 1
  439. endif
  440. `MOVE LIGHT
  441. `REFRESH SCREEN
  442. sync
  443. loop
  444. ` ***
  445. ` *** STOP MAIN SECTION
  446. ` ***
  447. ` *****************************************
  448. ` ***
  449. ` *** START END SECTION
  450. ` ***
  451. ` ***
  452. ` *** END SECTION HEADER
  453. ` ***
  454. EndSection:
  455. `DECLARE VARIABLES
  456. `SCREEN DISPLAY
  457. cls 0
  458. ink rgb(255,255,255),0
  459. center text 320,220, "GAME OVER"
  460. center text 320,260, "PLAY AGAIN [Y/N]?"
  461. `SOUND EFFECTS
  462. `SPECIAL EFFECTS
  463. `REFRESH SCREEN
  464. sync
  465. ` ***
  466. ` *** END SECTION LOOP
  467. ` ***
  468. do
  469. if scancode() = 0 then exit
  470. loop
  471. do
  472. `CONTROL INPUT
  473. if Inkey$() = "y"
  474. goto OptionsSection
  475. endif
  476.  
  477. if Inkey$() = "n"
  478. cls : end
  479. endif
  480. `REFRESH SCREEN
  481. sync
  482. loop
  483. end
  484. ` ***
  485. ` *** STOP END SECTION
  486. ` ***
  487. `***
  488. `*** END PROGRAM
  489. `***
  490. `*****************************************
  491. `*****************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement