sync on
sync rate 30
color backdrop 0
hide mouse
load image "media\herofighter.bmp",1
load image "media\enemyfighter.bmp",2
load image "media\powerup.bmp",3
load image "media\greenlaser.bmp",4
load image "media\yellowlaser.bmp",5
load image "media\experiance.bmp",6
load image "media\experiance2.bmp",7
load image "media\experiance3.bmp",8
load image "media\health.bmp",9
load image "media\starfield.bmp",50
load image "media\menu.bmp",9999
MAKE OBJECT PLAIN 4,600,56
ghost object on 4
POSITION OBJECT 4,0,-4,80
TEXTURE OBJECT 4,50
LOCK OBJECT ON 4
color backdrop rgb(0,0,0)
pf=0:score=0:Level=1:lives=3
ysx=50:ysy=200
sprite 1,ysx,ysy,1
lx=SPRITE X(1)+20
ly=SPRITE Y(1)+10
sprite 3,500,200,2
sprite 9999,10,10,9999
do
set cursor 200,400: Print "SCORE:";score; " LEVEL:";level;" LIVES:";lives
if UPKEY()=1 and ysy>100
dec ysy,10
endif
if DOWNKEY()=1 and ysy<350
inc ysy,10
endif
if inkey$()="z" and pf=0 then gosub shoot:pf=1
if SPRITE EXIST(2)=1
if SPRITE HIT(2,3)=1 then gosub blowitup
endif
sprite 1,ysx,ysy,1
gosub moveall
gosub movestars
sync
loop
movestars:
SCROLL OBJECT TEXTURE 4,0.01,0.0
return
shoot()
end
function shoot()
`load images
load image "media\greenlaser.bmp",1
load image "media\yellowlaser.bmp",2
hide mouse
x=320
y=240
xshot=x+10
BulletLife=0
do
if x>600 then x=600
if x<0 then x=0
`shoot
if returnkey()= 1
hide sprite 1
if sprite exist(2)= 1 then show sprite 2
sprite 2,x,y,2
xshot=x+10
BulletLife=60
else
if sprite exist(2)= 1 then hide sprite 2
if sprite exist(1)=1 then show sprite 1
sprite 1,x,y,1
endif
if rightkey()= 1
inc x,5
else
sprite 1,x,y,1
endif
if leftkey()= 1
dec x,5
else
sprite 1,x,y,1
endif
if spacekey()= 1
if sprite exist(1)=1 then show sprite 1
if sprite exist(2)= 1 then show sprite 2
sprite 2,x,y,2
else
if sprite exist(2)= 1 then hide sprite 2
if sprite exist(1)=1 then show sprite 1
sprite 1,x,y,1
endif
if BulletLife<=0
if sprite exist(3)=1 then hide sprite 3
else
if sprite exist(3)=1 then show sprite 3
sprite 3,xshot,250,3
inc xshot,5
dec BulletLife
endif
sync
loop
endfunction
moveall:
if SPRITE EXIST(2)=1
If sprite X(2)<640
lx=lx+45
sprite 2,lx,ly,4
endif
endif
if SPRITE EXIST(2)=1
If sprite X(2)>640
pf=0
lx=SPRITE X(1)+20
ly=SPRITE Y(1)+10
endif
endif
return
blowitup:
delete sprite 2
PLAY SOUND 2
for t=6 to 11
sprite 3,500,200,t
wait 1
next t
delete sprite 3
end
return
do
sync
loop
Im having a hard time trying to do a few things. One of them is trying to get my ship to shoot so i can see the visable beam. And also so i can make the enemy move around as well and have him try to dodge my shots instead of being a complete retard. Ive been trying to figure this out for awhile now, and i need some help. Can any of you guys help me?
War sickens man, and man is forced to fight. Only a true warrior enjoys the spoils of battle. Give forth your arm and you shall receive a sword. Now fight, for what you believe in.