global Sw,Sh load dll "user32.dll",1 Sw=call dll(1,"GetSystemMetrics",0) Sh=call dll(1,"GetSystemMetrics",1) delete dll 1 set display mode Sw,Sh,32,0 sync on : sync rate 30 autocam off : Rem Set autocamera options ink rgb(255,255,255),0 : set text font "times" : set text size 20 : set text to bold : set text transparent hide mouse randomize timer() set ambient light 10 score#=0:levelflag=1:play$="" gosub LevelOne do set cursor 0,0 print " LEVEL : ",levelflag print " score#= ",score# print " P1X#= ",P1X# print " P1Y#= ",P1Y# print " P1Z#= ",P1Z# print " 1 = still camera" print " 2 = top camera" print " 3 = follow camera" if object collision(1,6)= 1 position object 1, P1X#,P1Y#,P1Z# endif if object collision(1,7)= 1 position object 1, P1X#,P1Y#,P1Z# endif if object collision(1,8)= 1 position object 1, P1X#,P1Y#,P1Z# endif if object collision(1,9)= 1 position object 1, P1X#,P1Y#,P1Z# endif if object collision(1,10)= 1 position object 1, P1X#,P1Y#,P1Z# endif if object collision(1,11)= 1 position object 1, P1X#,P1Y#,P1Z# endif if object collision(1,12)= 1 position object 1, P1X#,P1Y#,P1Z# endif if object collision(1,13)= 1 position object 1, P1X#,P1Y#,P1Z# endif if object collision(1,14)= 1 position object 1, P1X#,P1Y#,P1Z# endif REM SPECIAL EFFECTS REM OBJECT ORIENTATIONS if collisionflag=0 OldP1X# = object position X(1) OldP1Y# = object position Y(1) OldP1Z# = object position Z(1) endif 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() For s = 25 to 31 if object exist(s) If Object collision (1,s) = 1 rem play sound 8 position object s , rnd(950)-rnd(950),25,rnd(950)-rnd(950) score#= score# + 1 endif endif Next s if Upkey()=1 then move object 1,10 if Downkey()=1 then move object 1,-10 if Leftkey()=1 then Yrotate object 1,wrapvalue(A1Y-5) if Rightkey()=1 then Yrotate object 1,wrapvalue(A1Y+5) if Inkey$()="1" position camera -20,100,-300 : Rem Set camera position point camera 0,50,0 : Rem Rotate camera to point at a specific place followMe = 0 : Rem Tell the program not to follow Object 1 endif if Inkey$()="2" 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$()="3" followMe = 1 : Rem Tell the program to follow Object 1 endif if Inkey$()="q" for x = 1 to 100 if object exist(x) = 1 then delete object x next x backdrop off gosub EndSection endif rem ----level changes---------- if score#>10 and levelflag=1 levelflag=2:gosub LevelTwo endif if score#>20 and levelflag=2 levelflag=3:gosub LevelThree endif rem -----------etcetera----------------- rem ----endsection------- if score#>30 and levelflag=3 then gosub EndSection REM 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#,200,cpZ# : Rem Set the camera placement Point camera P1X#,P1Y#+70,P1Z# : Rem Point camera at the top of Object 1 AUTOMATIC CAMERA COLLISION 0, 5, 1 endif REM REFRESH SCREEN sync loop LevelOne: REM DECLARE VARIABLES REM SCREEN DISPLAY cls 0 backdrop on color backdrop rgb(50,0,50) REM LOAD IMAGES remstart load image "C:\Users\tyler_hatha172\Desktop\Textures\treetop.jpg", 1 load image "C:\Users\tyler_hatha172\Desktop\Textures\treebark.jpg", 2 load image "C:\Users\tyler_hatha172\Desktop\Textures\lavapool.jpg",3 load image "C:\Users\tyler_hatha172\Desktop\Textures\bloodmoon.jpg", 4 load image "C:\Users\tyler_hatha172\Desktop\Textures\pentacle1.jpg", 5 load image "C:\Users\tyler_hatha172\Desktop\Textures\pentacle3.jpg", 6 REM LOAD MUSIC load music "M:\Video Game Design\Phase 4\Sounds\Lilith.wav", 7 load sound "M:\Video Game Design\Phase 4\Sounds\pickup.wav", 8 play music 7 loop music 7 remend REM OBJECT CREATION objnum=1 make object cone objnum, 100 texture object objnum, 6 position object objnum, 0,0,0 set object objnum,1,1,0 xrotate object objnum,90 fix object pivot objnum color object objnum,rgb(200,10,10) set object collision on objnum make object collision box objnum ,-50,-50,-50, 50,50,50,1 REM GROUND objnum=2 make object plain objnum, 3000,3000,10 texture object objnum,3 color object objnum,rgb(10,10,200) rotate object objnum, 90,0,0 REM EAST WALL objnum=3 make object box objnum, 3000,1000,10 position object objnum, 1500,500,0 rotate object objnum, 0,270,0 texture object objnum,4 set object collision on objnum rem make object collision box objnum ,-1500,-500,-10, 1500,500,10,1 REM NORTH WALL objnum=4 make object box objnum, 3000,1000,10 position object objnum, -1500,500,0 rotate object objnum, 0,270,0 texture object objnum,4 set object collision on objnum rem make object collision box objnum ,-1500,-500,-10, 1500,500,10,1 REM SOUTH WALL objnum=5 make object box objnum, 3000,1000,10 position object objnum, 0,500,1500 texture object objnum,4 set object collision on objnum rem make object collision box objnum ,-1500,-500,-10, 1500,500,10,1 REM EAST WALL objnum=6 make object box objnum, 3000,1000,10 position object objnum, 0,500,-1500 texture object objnum,4 set object collision on objnum rem make object collision box objnum ,-1500,-500,-10, 1500,500,10,1 REM TREES objnum=7 make object cylinder objnum, 100 position object objnum, -300,0,200 texture object objnum,2 set object collision on objnum make object collision box objnum,-50,-50,-50,50,50,50,1 objnum=8 make object cylinder objnum, 100 position object objnum, 200,0,-450 texture object objnum,2 set object collision on objnum make object collision box objnum, -50,-50,-50 ,50,50,50,1 objnum=9 make object cylinder objnum, 100 position object objnum, 1000,0,-500 texture object objnum,2 set object collision on objnum make object collision box objnum, -50,-50,-50 ,50,50,50,1 objnum=10 make object cylinder objnum, 100 position object objnum, 400,0,100 texture object objnum,2 set object collision on objnum make object collision box objnum, -50,-50,-50 ,50,50,50,1 objnum=11 make object cylinder objnum, 100 position object objnum, -800,0,100 texture object objnum,2 set object collision on objnum make object collision box objnum, -50,-50,-50 ,50,50,50,1 objnum=12 make object cylinder objnum, 100 position object objnum, 900,0,200 texture object objnum,2 set object collision on objnum make object collision box objnum, -50,-50,-50 ,50,50,50,1 objnum=13 make object cylinder objnum, 100 position object objnum, -110,0,600 texture object objnum,2 set object collision on objnum make object collision box objnum, -50,-50,-50 ,50,50,50,1 objnum=14 make object cylinder objnum, 100 position object objnum, -600,0,750 texture object objnum,2 set object collision on objnum make object collision box objnum, -50,-50,-50 ,50,50,50,1 for n=7 to 14 color object n,rgb(150,150,20) next n REM LEAVES objnum=15 make object cone objnum, 200 position object objnum, -300,150,200 texture object objnum, 1 objnum=16 make object cone objnum, 200 position object objnum, 200,150,-450 texture object objnum, 1 objnum=17 make object cone objnum, 200 position object objnum, 1000,150,-500 texture object objnum, 1 objnum=18 make object cone objnum, 200 position object objnum, 400,150,100 texture object objnum, 1 objnum=19 make object cone objnum, 200 position object objnum, -800,150,100 texture object objnum, 1 objnum=20 make object cone objnum, 200 position object objnum, 900,150,200 texture object objnum, 1 objnum=21 make object cone objnum, 200 position object objnum, -110,150,600 texture object objnum, 1 objnum=22 make object cone objnum, 200 position object objnum, -600,150,750 texture object objnum, 1 for n=15 to 22 color object n,rgb(10,200,10) next n REM LIGHT make light 23 set light range 23, 1000 position light 23, 0,100,0 point light 23, 0,0,0 make light 24 set light range 24, 1000 position light 24, 0,100,0 point light 24, 0,20,0 Rem SPHERES for s = 25 to 31 make object sphere s, 100 texture object s , 5 position object s, rnd(950)-rnd(950),25,rnd(950)-rnd(950) next s REM SET CAMERA position camera -20,200,-300 : Rem Set camera position point camera 0,50,0 : Rem Rotate camera to point at a specific place REM REFRESH SCREEN sync return LevelTwo: REM OBJECT CREATION REM GROUND objnum=2 color object objnum,rgb(100,100,100) rem trees for n=7 to 14 color object n,rgb(100,100,20) next n rem leaves for n=15 to 22 color object n,rgb(10,100,10) next n rem sphers for s = 25 to 31 position object s, rnd(950)-rnd(950),25,rnd(950)-rnd(950) next s REM SET CAMERA position camera -20,200,-300 : Rem Set camera position point camera 0,50,0 : Rem Rotate camera to point at a specific place REM REFRESH SCREEN sync return LevelThree: REM GROUND objnum=2 color object objnum,rgb(50,100,50) rem trunks for n=7 to 14 color object n,rgb(50,50,10) next n rem leaves for n=15 to 22 color object n,rgb(10,100,100) next n rem spheres for s = 25 to 31 position object s, rnd(950)-rnd(950),25,rnd(950)-rnd(950) next s REM SET CAMERA position camera -20,200,-300 : Rem Set camera position point camera 0,50,0 : Rem Rotate camera to point at a specific place REM REFRESH SCREEN sync return EndSection: REM SCREEN DISPLAY ink rgb(255,255,255),0 : set text font "times" : set text size 20 : set text to bold : set text transparent cls 0 sync clear entry buffer center text 400,560,"PLAY AGAIN [y or esc for no]? (make choice and press enter)" sync:wait key play$=entry$() If play$="y" score#=0:levelflag=1 gosub LevelOne endif return end