TGC Codebase Backup



Rockets 2 by Gillypie

24th Oct 2005 5:12
Summary

A Game where you are a rocket that has misiles flying to earth which you need to shoot.



Description

instructions
shoot space
left left
right right

shoot the boxes before they pass the line. more boxes apear in time.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    start:

REM Rocket II (The anti rocket demons)
REM By David & Brian Williams
Hide Mouse


do
center text 320,30,"Rocket Episode II"
center text 320,250,"The Anti-Earth Misiles"
print "press enter to start"
if returnkey()=1 then goto game
cls
loop

game:
load sound "explode4.wav",1
load sound "scream1.wav",2
DIM bx(500):Dim by(500)
sync on
bax1=40:bay1=0:bax2=40:bay2=600
ex1=700:ey1=Rnd(500)
ex2=700:ey2=Rnd(500)
ex3=700:ey3=Rnd(500)
ex4=700:ey4=rnd(500)
plx=100:ply=300
b=0:a=1:t=0
points#=0




sync on
do
REM draw me rocket
line bax1,bay1,bax2,bay2
line plx,ply,(plx-50),(ply-10)
line plx,ply,(plx-50),ply
line (plx-50),ply,(plx-50),(ply-10)
If upkey()=1 then ply=ply-3
If downkey()=1 then ply=ply+3
t#=t#+1

ex1=ex1-5

if points#>5 then ex2=ex2-5

if points#>10 then ex3=ex3-5

if points#>15 then ex4=ex4-5



box ex1,ey1,(ex1+30),(ey1+20)
box ex2,ey2,(ex2+30),(ey2+20)
box ex3,ey3,(ex3+30),(ey3+20)
box ex4,ey4,(ex4+30),(ey4+20)
if t#>10
if spacekey()=1
t#=0
b=b+1
bx(b)=plx
by(b)=ply
endif
endif

print points#

For c=a to b
circle bx(c),by(c),1
bx(c)=bx(c)+10
If bx(c)>700 then a=a+1
next c

if ex1=0 
sync off
play sound 2
goto end
endif


if ex2=0 
sync off
play sound 2
goto end
endif


if ex3=0 
sync off
play sound 2
goto end
endif


if ex4=0 
sync off
play sound 2
goto end
endif
sync


if ply<10 then ply=500
if ply>510 then ply=10

if bx(b)>(ex1+10) and bx(b)<(ex1+40) and by(b)>ey1 and by(b)<(ey1+40)
print "bang"
play sound 1
points#=points#+1
ex1=700
ey1=rnd(450)
endif

if bx(b)>(ex2+10) and bx(b)<(ex2+40) and by(b)>ey2 and by(b)<(ey2+40)
print "bang"
play sound 1
points#=points#+1
ex2=700
ey2=rnd(450)
endif


if bx(b)>(ex3+10) and bx(b)<(ex3+40) and by(b)>ey3 and by(b)<(ey3+40)
print "bang"
play sound 1
points#=points#+1
ex3=700
ey3=rnd(450)
endif
cls


if bx(b)>(ex4+10) and bx(b)<(ex4+40) and by(b)>ey4 and by(b)<(ey4+40)
print "bang"
play sound 1
points#=points#+1
ex4=700
ey4=rnd(450)
endif

loop
end:
do

center text 320,30,"Darn, the earth exploded!"
center text 320,250,"Press 'Enter' to replay"
if returnkey()=1 then goto start
loop