Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `*****************************************
- `*****************************************
- `***
- `*** TITLE - Game Template
- `*** VERSION - 1.0.0b LAST UPDATED - 3.8.2016
- `*** DEVELOPER - Jason Holm
- `*** COPYRIGHT - Ingenious Student Labs
- `*** DATE CREATED - 1.1.2005
- `*** EDITED BY Kealan Johnson
- `*** EDITING DATE - 5/8/19
- ` ***
- ` *** START SYSTEM SETUP SECTION
- ` ***
- sync on
- sync rate 30
- autocam off
- hide mouse
- randomize timer()
- ` ***
- ` *** STOP SYSTEM SETUP SECTION
- ` ***
- ` ***************************************
- ` ***
- ` *** START INTRO SECTION
- ` ***
- ` ***
- ` *** INTRO SECTION HEADER
- ` ***
- `DECLARE VARIABLES
- `SCREEN DISPLAY
- cls RGB (200, 90, 0)
- ink rgb (125, 0, 125),0
- center text 320,220,"PHASE 4 TEASER"
- center text 320,260,"HIT ANY KEY TO BEGIN"
- `LOAD SOUNDS
- `SOUND EFFECTS
- `SPECIAL EFFECTS
- `REFRESH SCREEN
- sync
- ` ***
- ` *** INTRO SECTION LOOP
- ` ***
- do
- `SCREEN DISPLAY
- `CONTROL INPUT
- if keystate( scancode() ) = 1 then goto OptionsSection
- `REFRESH SCREEN
- sync
- loop
- ` ***
- ` *** END INTRO SECTION
- ` ***
- ` *****************************************
- ` ***
- ` *** START OPTIONS SECTION
- ` ***
- ` ***
- ` *** OPTIONS SECTION HEADER
- ` ***
- OptionsSection:
- `DECLARE VARIABLES
- `Levels
- TotalLevels = 1 : `Total number of levels
- LevelNumber = 1 : `Start on Level 1
- `SCREEN DISPLAY
- cls RGB (0, 180, 100)
- ink rgb(0, 50, 0),0
- center text 320,220,"PRESS E FOR ABOVE THE MAP VIEW, OR PRESS F FOR THIRD PERSON VIEW"
- center text 320,260,"HIT ANY KEY TO BEGIN"
- `LOAD SOUNDS
- `SOUND EFFECTS
- `SPECIAL EFFECTS
- `REFRESH SCREEN
- sync
- ` ***
- ` *** OPTIONS SECTION LOOP
- ` ***
- do
- if scancode() = 0 then exit
- loop
- do
- `SCREEN DISPLAY
- `CONTROL INPUT
- if Keystate(scancode())=1 then goto LevelIntroSection
- `REFRESH SCREEN
- sync
- loop
- ` ***
- ` *** END OPTIONS SECTION
- ` ***
- ` *****************************************
- ` ***
- ` *** START LEVEL INTRO SECTION
- ` ***
- ` ***
- ` *** OPTIONS SECTION HEADER
- ` ***
- LevelIntroSection:
- `DECLARE VARIABLES
- `SCREEN DISPLAY
- cls RGB(125, 0, 255)
- ink rgb(15, 0, 0),0
- Set Text size 30
- center text 310,220, "LEVEL"
- set cursor 355,220
- print LevelNumber
- Set Text size 10
- center text 320,245, "HIT ANY KEY TO BEGIN"
- `LOAD SOUNDS
- Load sound "Sounds/bite.wav", 1
- Load music "Music/music.mp3", 2
- Set music volume 2, 100
- Loop music 2
- `SOUND EFFECTS
- `SPECIAL EFFECTS
- `REFRESH SCREEN
- sync
- ` ***
- ` *** OPTIONS SECTION LOOP
- ` ***
- do
- if scancode() = 0 then exit
- loop
- do
- `SCREEN DISPLAY
- `CONTROL INPUT
- if keystate( scancode() ) = 1 then goto MainSection
- `REFRESH SCREEN
- sync
- loop
- ` ***
- ` *** END LEVEL INTRO SECTION
- ` ***
- ` *****************************************
- ` ***
- ` *** START MAIN SECTION
- ` ***
- ` ***
- ` *** MAIN SECTION HEADER
- ` ***
- MainSection:
- `DECLARE VARIABLES
- `Player Character
- MyTimer = 1500 : rem MyTimer / sync rate = seconds on timer (approx.)
- Gravity# = 1 : rem How powerful gravity is
- MyPower = 10 : rem How strong the player can jump
- MySpeed = 9 : rem How fast the player can run
- `Projectiles
- `Enemies
- `Other
- `Score
- MyScore = 0
- MyAcceleration# = 0.0 : rem Start without jumping or falling
- REM Make Light
- Make Light 25
- Set Light Range 25, 10000
- Position Light 25, 0,100,0
- Point Light 25, 0,0,0
- Make Light 26
- Set Light Range 26, 10000
- Position Light 26, 0,100,0
- Point Light 26, 0,20,0
- `LOAD IMAGES
- Load Image "Images/texture 18.jpg", 1
- Load Image "Images/sky.bmp",2
- Load Image "Images/rocky05.bmp",3
- Load Image "Images/walls/cave02.bmp",4
- Load Image "Images/exterior/window01.bmp",5
- Load Image "Images/grassy01.bmp",6
- Load Image "Images/green/bark07", 7
- Load Image "Images/leaves.jpg", 8
- Load Image "Images/watermelon.jpg", 9
- Load Image "Images/lemon.jpg", 10
- Load Image "Images/lime.jpg", 11
- Load Image "Images/strawberry.jpg", 12
- `SCREEN DISPLAY
- cls 0
- backdrop on
- `TEXT
- `HEADS-UP DISPLAY (HUD)
- `OBJECT CREATION
- `World Map
- `Player Character
- make object cone 1, 50 :
- Texture object 1, 1
- position object 1, 0, 25, 0
- Scale object 1, 150, 500, 100
- REM North Wall - Light Blue
- make Object Box 2, 3000,1000,10 :
- Texture object 2, 2
- position Object 2, 0,500,1500
- REM East Wall - Light Red
- make Object Box 3, 3000,1000,10 :
- Texture object 3, 3
- rotate Object 3, 0,90,0
- position Object 3, 1500,500,0
- REM West Wall - Yellow Orange
- make Object Box 4, 3000,1000,10 :
- Texture object 4, 4
- rotate Object 4,0,90,0
- position Object 4, -1500,500,0
- REM South Wall - Blue Green
- make Object Box 5, 3000,1000,10 :
- Texture object 5, 5
- position Object 5, 0,500,-1500
- REM Floor - Green
- make Object Plain 6, 3000,3000,10 :
- Texture object 6, 6
- position Object 6, 0,0,0
- rotate Object 6, 90,0,0
- REM Tree 1
- make Object Cylinder 7, 75 :
- Texture object 7, 7
- position Object 7, 0,10,-300
- scale Object 7, 10,250,10
- REM Tree 2
- make Object Cylinder 8, 75 :
- Texture object 8, 7
- position Object 8, 300,10,0
- scale Object 8, 10,250,10
- REM Tree 3
- make Object Cylinder 9, 75 :
- Texture object 9, 7
- position Object 9, 600,10,0
- scale Object 9, 10,250,10
- REM Tree 4
- make Object Cylinder 10, 75 :
- Texture object 10, 7
- position Object 10, -300,10,0
- scale Object 10, 10,250,10
- REM Tree 5
- make Object Cylinder 11, 75 :
- Texture object 11, 7
- position Object 11, -600,10,0
- scale Object 11, 10,250,10
- REM Tree 6
- make Object Cylinder 12, 75 :
- Texture object 12, 7
- position Object 12, 0,10,300
- scale Object 12, 10,250,10
- REM Leaves 1
- make Object Cone 13, 100 :
- Texture object 13, 8
- position Object 13, 300,125,0
- scale Object 13, 75,75,75
- REM Leaves 2
- make Object Cone 14, 100 :
- Texture object 14, 8
- position Object 14, 600,125,0
- scale Object 14, 75,75,75
- REM Leaves 3
- make Object Cone 15, 100 :
- Texture object 15, 8
- position Object 15, -300,125,0
- scale Object 15, 75,75,75
- REM Leaves 4
- make Object Cone 16, 100 :
- Texture object 16, 8
- position Object 16, -600,125,0
- scale Object 16, 75,75,75
- REM Leaves 5
- make Object Cone 17, 100 :
- Texture object 17, 8
- position Object 17, 0,125,300
- scale Object 17, 75,75,75
- REM Leaves 6
- make Object Cone 18, 100 :
- Texture object 18, 8
- position Object 18, 0,125,-300
- scale Object 18, 75,75,75
- NumberOfSpheres=100 : NS = NumberOfSpheres + 19
- for x=19 to NS : Rem Cones
- make object sphere x, rnd(50)+50
- fruit = rnd(3)+9
- texture object x, fruit
- do
- NoCenterX = rnd(2000)-1000
- NoCenterZ = rnd(2000)-1000
- if (NoCenterX > -150 and NoCenterX < 150 and NoCenterZ > -150 and NoCenterZ < 150) = 0 then exit
- if (NoCenterX > -150 and NoCenterX < 150 and NoCenterZ > -150 and NoCenterZ < 150) = 0 and NoCenterZ > 150 then exit
- loop
- position object x, NoCenterX,object size(x)*.75,NoCenterZ
- next x
- `Enemies
- `Pick-Ups
- `LOAD MODELS
- `SET LIGHTS
- `SET CAMERA
- followMe = 1 :
- `SOUND EFFECTS
- `SPECIAL EFFECTS
- `REFRESH SCREEN
- sync
- ` ***
- ` *** MAIN SECTION LOOP
- ` ***
- do
- if scancode() = 0 then exit
- loop
- do
- `SPECIAL EFFECTS
- REM OBJECT ORIENTATIONS
- P1X# = object position X(1)
- P1Y# = object position Y(1)
- P1Z# = object position Z(1)
- A1X = object angle X(1)
- A1Y = object angle Y(1)
- A1Z = object angle Z(1)
- REM CAMERA ORIENTATIONS
- Rem Store the positions of the Camera as variables
- cpX# = camera position X()
- cpY# = camera position Y()
- cpZ# = camera position Z()
- Rem Store the angles of the Camera as variables
- caX# = camera angle X()
- caY# = camera angle Y()
- caZ# = camera angle Z()
- `OBJECT ORIENTATIONS (Pre-Movement, Pre-Collision)
- `Player Character
- P1X# = object position X(1)
- P1Y# = object position Y(1)
- P1Z# = object position Z(1)
- A1X = object angle X(1)
- A1Y = object angle Y(1)
- A1Z = object angle Z(1)
- `Projectiles
- `Enemies
- `LIVE SCREEN DISPLAY
- `TEXT
- Set cursor 10, 10
- Print " Score: ", MyScore
- set text size 10
- center text 320, 430, "PRESS E FOR ABOVE THE MAP VIEW, OR PRESS F FOR THIRD PERSON VIEW"
- center text 320,440,"USE ARROW KEYS OR WASD TO MOVE | PRESS 'Q' TO QUIT"
- `HUD
- `CONTROL INPUT
- `Acceleration and Pitch
- if Upkey()=1 or keystate(17)=1 then move object 1,10
- if Downkey()=1 or keystate(31)=1 then move object 1,-10
- `Turning and Banking
- if Leftkey()=1 or keystate(30)=1 then Yrotate object 1,wrapvalue(A1Y-5)
- if Rightkey()=1 or keystate(32)=1 then Yrotate object 1,wrapvalue(A1Y+5)
- `Releasing Projectiles
- `Quit Game
- if Inkey$() = "q"
- for x = 1 to 100 REM to highest object number
- if object exist (x) = 1 then delete object x
- if light exist (x) = 1 then delete object x
- next x
- backdrop off
- goto EndSection
- endif
- `Camera Control
- if Inkey$()="e"
- position camera 0,1500,0 : Rem Set camera position
- point camera 0,0,0 : Rem Rotate camera to point at a specific place
- followMe = 0 : Rem Tell the program not to follow Object 1
- endif
- if Inkey$()="f"
- followMe = 1 : Rem Tell the program to follow Object 1
- endif
- `TRANSFORM OBJECTS
- `MOVE OBJECTS
- `Player Character
- `Projectiles
- `Enemies
- `OBJECT ORIENTATIONS (Post-Movement, Pre-Collision)
- `Player Character
- newP1X# = object position X(1)
- newP1Y# = object position Y(1)
- newP1Z# = object position Z(1)
- newA1X = object angle X(1)
- newA1Y = object angle Y(1)
- newA1Z = object angle Z(1)
- `Projectiles
- `Enemies
- `CHECK COLLISIONS
- `Player Character
- `Walls
- for t = 7 to 18
- if object collision (1, t)> 0 then
- position object 1, P1X#, P1Y#, P1Z#
- next t
- for w = 2 to 5
- if object collision (1, w)> 0 then
- position object 1, P1X#, P1Y#, P1Z#
- next w
- `Pick-Ups
- for p = 19 to 119
- if object collision (1,p) >0
- set sound volume 1, 100
- play sound 1
- MyScore = Myscore + 100
- exclude object on p
- endif
- next p
- `Enemies
- `Projectiles
- `Walls
- `Enemies
- `Enemies
- `Walls
- `OBJECT ORIENTATIONS (Post-Movement, Post-Collision)
- `Player Character
- P1X# = object position X(1)
- P1Y# = object position Y(1)
- P1Z# = object position Z(1)
- A1X = object angle X(1)
- A1Y = object angle Y(1)
- A1Z = object angle Z(1)
- `Projectiles
- `Enemies
- `CHECK PLAYER EXPIRATION
- `MOVE CAMERA
- if followMe = 1 : Rem If the camera is following Object 1
- cpZ# = Newzvalue(P1Z#,A1Y-180,200) : Rem Calculate the camera's new Z position
- cpX# = Newxvalue(P1X#,A1Y-180,200) : Rem Calculate the camera's new X position
- Position camera cpX#,300,cpZ# : Rem Set the camera placement
- Point camera P1X#,P1Y#+200,P1Z# : Rem Point camera at the top of Object 1
- endif
- `MOVE LIGHT
- `REFRESH SCREEN
- sync
- loop
- ` ***
- ` *** STOP MAIN SECTION
- ` ***
- ` *****************************************
- ` ***
- ` *** START END SECTION
- ` ***
- ` ***
- ` *** END SECTION HEADER
- ` ***
- EndSection:
- `DECLARE VARIABLES
- `SCREEN DISPLAY
- cls 0
- ink rgb(255,255,255),0
- center text 320,220, "GAME OVER"
- center text 320,260, "PLAY AGAIN [Y/N]?"
- `SOUND EFFECTS
- `SPECIAL EFFECTS
- `REFRESH SCREEN
- sync
- ` ***
- ` *** END SECTION LOOP
- ` ***
- do
- if scancode() = 0 then exit
- loop
- do
- `CONTROL INPUT
- if Inkey$() = "y"
- goto OptionsSection
- endif
- if Inkey$() = "n"
- cls : end
- endif
- `REFRESH SCREEN
- sync
- loop
- end
- ` ***
- ` *** STOP END SECTION
- ` ***
- `***
- `*** END PROGRAM
- `***
- `*****************************************
- `*****************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement