REM Project: overheadshooter
REM Created: 5/24/2007 5:30:00 PM
REM
REM ***** Main Source File *****
REM
global s as word
global st as word
global e1 as byte
global e2 as byte
global e3 as byte
global k as word
global a as word
global yc# as byte
global t as dword
 
sync on: sync rate 600
instructions()
do
loop
function turretcon()
make camera 1:position camera 1,10,20,10:pitch camera down 1,90
color backdrop 1,rgb(0,0,0)
make object cube 1,1
position object 1,10,0,10
make object sphere 2,1
position object 2,10,1,10
make object cube 3,1
position object 3,10,.5,10
scale object 3,142,20,20
color object 1,rgb(40,40,40)
color object 2,rgb(35,65,35)
color object 3,rgb(20,20,20)
 
make object cube 15,1;scale object 15,100,100,2000;position object 15,-.5,0,10
make object cube 16,1;scale object 16,100,100,2000;position object 16,20.5,0,10
make object cube 17,1;scale object 17,2000,100,100;position object 17,10,0,-.5
make object cube 18,1;scale object 18,2000,100,100;position object 18,10,0,20.5
for q=15 to 18
color object q,rgb(0,255,0)
next q
 
game()
endfunction
 
function game()
s=5
a=20
yc#=1.2
make particles 1,0,2,3;rotate particles 1,50,0,0;position particle emissions 1,50,0,0
color particles 1,255,100,0
 
do
set text size 20
`text 0,0,"KILLS:"+str$(k)
`text 0,20,"TIME:"+str$(t)
t=t+1
if t= 500;enemymaker1();endif
if t=2000;enemymaker2();endif
if t=2500;enemymaker3();endif
if t=5000;yc#=1;endif
if e1=1;e1();endif
if e2=1;e2();endif
if e3=1;e3();endif
st=st+1
 
if rightkey()=1;y=y+yc#;yrotate object 1,y;yrotate object 3,y;endif
if leftkey()=1;y=y-yc#;yrotate object 1,y;yrotate object 3,y;endif
if spacekey()=1;if st=>35;fire();endif;endif
shotn5()
shotn6()
shotn7()
shotn8()
shotn9()
shotn10()
shotn11()
shotn12()
shotn13()
shotn14()
 
randomize timer()
sync;loop
endfunction
 
function e1()
point object 20,10,0,10;move object 20,.02;if object hit(1,20);gameover();endif
position object 20,object position x(20),.6,object position z(20)
endfunction
function e2()
point object 21,10,0,10;move object 21,.02;if object hit(1,21);gameover();endif
position object 21,object position x(21),.6,object position z(21)
endfunction
function e3()
point object 22,10,0,10;move object 22,.01;if object hit(1,22);gameover();endif
position object 22,object position x(20),.6,object position z(22)
endfunction
 
function enemymaker1()
make object sphere 20,1;scale object 20,50,50,50;position object 20,rnd(20),.6,0
color object 20,rgb(255,0,0)
e1=1
endfunction
function enemymaker2()
make object sphere 21,1;scale object 21,50,50,50;position object 21,rnd(20),.6,20
color object 21,rgb(255,0,0)
e2=1
endfunction
function enemymaker3()
make object sphere 22,1;scale object 22,50,50,50;position object 22,rnd(20),.6,20
color object 22,rgb(255,0,0)
e3=1
endfunction
 
function fire()
st=0
make object cube s,1
scale object s,25,25,25
position object s,10,.6,10
color object s,rgb(000,150,50)
set object to object orientation s,1
s=s+1
if s=15;s=5;endif
exitfunction
endfunction
 
 
 
function shotn5()
if object exist(5);move object 5,-.05;
if object position x(5)=>20;d5=1;position particle emissions 1,object position x(5),1,object position z(5);endif
if object position x(5)=<-0;d5=1;position particle emissions 1,object position x(5),1,object position z(5);endif
if object position z(5)=>20;d5=1;position particle emissions 1,object position x(5),1,object position z(5);endif
if object position z(5)=<-0;d5=1;position particle emissions 1,object position x(5),1,object position z(5);endif
if object exist(20);if object hit(5,20);position object 20,rnd(20),.6,0;k=k+1;position particle emissions 1,object position x(5),1,object position z(5);endif;endif
if object exist(21);if object hit(5,21);position object 21,rnd(21),.6,0;k=k+1;position particle emissions 1,object position x(5),1,object position z(5);endif;endif
if object exist(22);if object hit(5,22);position object 22,rnd(20),.6,20;k=k+1;position particle emissions 1,object position x(5),1,object position z(5);endif;endif
if d5=1;delete object 5;endif
endif
endfunction
function shotn6()
if object exist(6);move object 6,-.05;
if object position x(6)=>20;d6=1;position particle emissions 1,object position x(6),1,object position z(6);endif
if object position x(6)=<-0;d6=1;position particle emissions 1,object position x(6),1,object position z(6);endif
if object position z(6)=>20;d6=1;position particle emissions 1,object position x(6),1,object position z(6);endif
if object position z(6)=<-0;d6=1;position particle emissions 1,object position x(6),1,object position z(6);endif
if object exist(20);if object hit(6,20);position object 20,rnd(20),.6,0;k=k+1;;position particle emissions 1,object position x(6),1,object position z(6);endif;endif
if object exist(21);if object hit(6,21);position object 21,rnd(21),.6,0;k=k+1;;position particle emissions 1,object position x(6),1,object position z(6);endif;endif
if object exist(22);if object hit(6,22);position object 22,rnd(20),.6,20;k=k+1;;position particle emissions 1,object position x(6),1,object position z(6);endif;endif
if d6=1;delete object 6;endif
endif
endfunction
function shotn7()
if object exist(7);move object 7,-.05;
if object position x(7)=>20;d7=1;position particle emissions 1,object position x(7),1,object position z(7);endif
if object position x(7)=<-0;d7=1;position particle emissions 1,object position x(7),1,object position z(7);endif
if object position z(7)=>20;d7=1;position particle emissions 1,object position x(7),1,object position z(7);endif
if object position z(7)=<-0;d7=1;position particle emissions 1,object position x(7),1,object position z(7);endif
if object exist(20);if object hit(7,20);position object 20,rnd(20),.6,0;k=k+1;position particle emissions 1,object position x(7),1,object position z(7);endif;endif
if object exist(21);if object hit(7,21);position object 21,rnd(21),.6,0;k=k+1;position particle emissions 1,object position x(7),1,object position z(7);endif;endif
if object exist(22);if object hit(7,22);position object 22,rnd(20),.6,20;k=k+1;position particle emissions 1,object position x(7),1,object position z(7);endif;endif
if d7=1;delete object 7;endif
endif
endfunction
function shotn8()
if object exist(8);move object 8,-.05;
if object position x(8)=>20;d8=1;position particle emissions 1,object position x(8),1,object position z(8);endif
if object position x(8)=<-0;d8=1;position particle emissions 1,object position x(8),1,object position z(8);endif
if object position z(8)=>20;d8=1;position particle emissions 1,object position x(8),1,object position z(8);endif
if object position z(8)=<-0;d8=1;position particle emissions 1,object position x(8),1,object position z(8);endif
if object exist(20);if object hit(8,20);position object 20,rnd(20),.6,0;k=k+1;position particle emissions 1,object position x(8),1,object position z(8);endif;endif
if object exist(21);if object hit(8,21);position object 21,rnd(21),.6,0;k=k+1;position particle emissions 1,object position x(8),1,object position z(8);endif;endif
if object exist(22);if object hit(8,22);position object 22,rnd(20),.6,20;k=k+1;position particle emissions 1,object position x(8),1,object position z(8);endif;endif
if d8=1;delete object 8;endif
endif
endfunction
function shotn9()
if object exist(9);move object 9,-.05;
if object position x(9)=>20;d9=1;position particle emissions 1,object position x(9),1,object position z(9);endif
if object position x(9)=<-0;d9=1;position particle emissions 1,object position x(9),1,object position z(9);endif
if object position z(9)=>20;d9=1;position particle emissions 1,object position x(9),1,object position z(9);endif
if object position z(9)=<-0;d9=1;position particle emissions 1,object position x(9),1,object position z(9);endif
if object exist(20);if object hit(9,20);position object 20,rnd(20),.6,0;k=k+1;position particle emissions 1,object position x(9),1,object position z(9);endif;endif
if object exist(21);if object hit(9,21);position object 21,rnd(21),.6,0;k=k+1;position particle emissions 1,object position x(9),1,object position z(9);endif;endif
if object exist(22);if object hit(9,22);position object 22,rnd(20),.6,20;k=k+1;position particle emissions 1,object position x(9),1,object position z(9);endif;endif
if d9=1;delete object 9;endif
endif
endfunction
function shotn10()
if object exist(10);move object 10,-.05;
if object position x(10)=>20;d10=1;position particle emissions 1,object position x(10),1,object position z(10);endif
if object position x(10)=<-0;d10=1;position particle emissions 1,object position x(10),1,object position z(10);endif
if object position z(10)=>20;d10=1;position particle emissions 1,object position x(10),1,object position z(10);endif
if object position z(10)=<-0;d10=1;position particle emissions 1,object position x(10),1,object position z(10);endif
if object exist(20);if object hit(10,20);position object 20,rnd(20),.6,0;k=k+1;position particle emissions 1,object position x(10),1,object position z(10);endif;endif
if object exist(21);if object hit(10,21);position object 21,rnd(21),.6,0;k=k+1;position particle emissions 1,object position x(10),1,object position z(10);endif;endif
if object exist(22);if object hit(10,22);position object 22,rnd(20),.6,20;k=k+1;position particle emissions 1,object position x(10),1,object position z(10);endif;endif
if d10=1;delete object 10;endif
endif
endfunction
function shotn11()
if object exist(11);move object 11,-.05;
if object position x(11)=>20;d11=1;position particle emissions 1,object position x(11),1,object position z(11);endif
if object position x(11)=<-0;d11=1;position particle emissions 1,object position x(11),1,object position z(11);endif
if object position z(11)=>20;d11=1;position particle emissions 1,object position x(11),1,object position z(11);endif
if object position z(11)=<-0;d11=1;position particle emissions 1,object position x(11),1,object position z(11);endif
if object exist(20);if object hit(11,20);position object 20,rnd(20),.6,0;k=k+1;position particle emissions 1,object position x(11),1,object position z(11);endif;endif
if object exist(21);if object hit(11,21);position object 21,rnd(21),.6,0;k=k+1;position particle emissions 1,object position x(11),1,object position z(11);endif;endif
if object exist(22);if object hit(11,22);position object 22,rnd(20),.6,20;k=k+1;position particle emissions 1,object position x(11),1,object position z(11);endif;endif
if d11=1;delete object 11;endif
endif
endfunction
function shotn12()
if object exist(12);move object 12,-.05;
if object position x(12)=>20;d12=1;position particle emissions 1,object position x(12),1,object position z(12);endif
if object position x(12)=<-0;d12=1;position particle emissions 1,object position x(12),1,object position z(12);endif
if object position z(12)=>20;d12=1;position particle emissions 1,object position x(12),1,object position z(12);endif
if object position z(12)=<-0;d12=1;position particle emissions 1,object position x(12),1,object position z(12);endif
if object exist(20);if object hit(12,20);position object 20,rnd(20),.6,0;k=k+1;position particle emissions 1,object position x(12),1,object position z(12);endif;endif
if object exist(21);if object hit(12,21);position object 21,rnd(21),.6,0;k=k+1;position particle emissions 1,object position x(12),1,object position z(12);endif;endif
if object exist(22);if object hit(12,22);position object 22,rnd(20),.6,20;k=k+1;position particle emissions 1,object position x(12),1,object position z(12);endif;endif
if d12=1;delete object 12;endif
endif
endfunction
function shotn13()
if object exist(13);move object 13,-.05;
if object position x(13)=>20;d13=1;position particle emissions 1,object position x(13),1,object position z(13);endif
if object position x(13)=<-0;d13=1;position particle emissions 1,object position x(13),1,object position z(13);endif
if object position z(13)=>20;d13=1;position particle emissions 1,object position x(13),1,object position z(13);endif
if object position z(13)=<-0;d13=1;position particle emissions 1,object position x(13),1,object position z(13);endif
if object exist(20);if object hit(13,20);position object 20,rnd(20),.6,0;k=k+1;position particle emissions 1,object position x(13),1,object position z(13);endif;endif
if object exist(21);if object hit(13,21);position object 21,rnd(21),.6,0;k=k+1;position particle emissions 1,object position x(13),1,object position z(13);endif;endif
if object exist(22);if object hit(13,22);position object 22,rnd(20),.6,20;k=k+1;position particle emissions 1,object position x(13),1,object position z(13);endif;endif
if d13=1;delete object 13;endif
endif
endfunction
function shotn14()
if object exist(14);move object 14,-.05;
if object position x(14)=>20;d14=1;position particle emissions 1,object position x(14),1,object position z(14);endif
if object position x(14)=<-0;d14=1;position particle emissions 1,object position x(14),1,object position z(14);endif
if object position z(14)=>20;d14=1;position particle emissions 1,object position x(14),1,object position z(14);endif
if object position z(14)=<-0;d14=1;position particle emissions 1,object position x(14),1,object position z(14);endif
if object exist(20);if object hit(14,20);position object 20,rnd(20),.6,0;k=k+1;position particle emissions 1,object position x(14),1,object position z(14);endif;endif
if object exist(21);if object hit(14,21);position object 21,rnd(21),.6,0;k=k+1;position particle emissions 1,object position x(14),1,object position z(14);endif;endif
if object exist(22);if object hit(14,22);position object 22,rnd(20),.6,20;k=k+1;position particle emissions 1,object position x(14),1,object position z(14);endif;endif
if d14=1;delete object 14;endif
endif
endfunction
 
 
Function instructions
 
set text font "BankGothic Md BT":set text size 65;set text to bold:
text 100,75,"KABOOM"
set text size 20:set text to normal:line 80,75,80,320
text 100,140,"In KABOOM, your objective is to "
text 100,160,"destroy as many spheres as you can "
text 100,180,"before they reach and KILL you..."
text 100,200,"Use the arrowkeys to rotate your mounted gun"
text 100,220,"Press space to fire your gun."
text 100,300,"--press return to start--"
do:if returnkey()=1:turretcon();endif:sync:loop
endfunction
 
function gameover()
do
set text to bold;set text size 40
text 100,100,"GAME OVER"
set text to normal;set text size 20
text 120,150,"Your Kill count---"+str$(k)
text 120,170,"Plus You Time-----"+str$(t)
score=k*t
text 120,190,"Equals your score-"+str$(score)
text 120,220,"press return to quit"
if returnkey()=1
end
endif
sync
loop
endfunction