Here's my entry:
DARK SHOOTER!!
I'm bad at coming up with names...
anyway,
`Dark Shooter
`aka
`Nick's Shooting Game
`-----------------editable variables-------------------
`change when adding things to game
numcolors = 9 :`change when adding more colors for more images
numdrawings = 4 :`change when adding more images
numenemies = 2 :`change when adding more enemy drawings
`change to config game
numenemiesatatime = 3 :`max enemies on the screen at a time - up to 9
maxpowerupsatatime = 1 :`max powerups floating at a time - you'll usually want this at 1
maxshots = 8 :`max shots on the screen - up to 8
initialenemyspeed# = 1.5 :`initial speed enemies move at - up this to make it faster
maxescaped=9 :`max to let escape - if more than this escape the game is over
maxbombs=9 :`maximum number of bombs the player can have
sync on
intro:
otheight=text height("A")
theight=0
hide all sprites
cls 0
ink rgb(255,255,255),0
center text 176,theight,"Log of Argus Jiba, June 29, 3980" : inc theight,otheight*2
printslowly(0,theight,"I was on my way to investigate an emergency signal",1) : inc theight,otheight
printslowly(0,theight,"eminating from a planet in Sector 359 when my right",1) : inc theight,otheight
printslowly(0,theight,"thruster lost power, sending me on a new trajectory.",1) : inc theight,otheight*2
sleep 600
printslowly(0,theight,"Though I fought to keep the craft straight, I lost",1) : inc theight,otheight
printslowly(0,theight,"control and the spaceship crashed onto an uninhabited",1): inc theight,otheight
printslowly(0,theight,"planet somewhere in Sector 298.",1) : inc theight,otheight*2
sleep 800
printslowly(0,theight,"At least, I thought it was uninhabited...",1) : inc theight,otheight*2
sleep 400
printslowly(0,theight,"As I walked away from the wreckage of my ship, I came",1): inc theight,otheight
printslowly(0,theight,"upon some strange creatures that immediately tried to",1): inc theight,otheight
printslowly(0,theight,"eat me. I used the remaining power in my ship's",1): inc theight,otheight
printslowly(0,theight,"crushed generator to charge my laser pistol and get in",1): inc theight,otheight
printslowly(0,theight,"contact with Headquarters. I relayed the information",1): inc theight,otheight
printslowly(0,theight,"about the creatures, and recieved an answer just as my",1): inc theight,otheight
printslowly(0,theight,"generator lost power:",1) : inc theight,otheight*2
sleep 800
printslowly(0,theight,"ARGUS - DESTROY ALL ORGANISMS ON PLANET.",1) : inc theight,otheight*2
sleep 800
printslowly(0,theight,"And so, I set out on the unknown planet with nothing",1) : inc theight,otheight
printslowly(0,theight,"but my trusty laser pistol...",1) : inc theight,otheight*3
sleep 800
if scancode()>0 then goto menu
center text 176,theight,"PRESS ANY KEY TO START"
wait key
menu:
selecteditem=2
do
cls
theight=0
center text screen width()/2,theight,"Dark Shooter" : inc theight,otheight*4
if selecteditem=1
center text screen width()/2,theight,">Play<" : inc theight,otheight*2
else
center text screen width()/2,theight,"Play" : inc theight,otheight*2
endif
if selecteditem=2
center text screen width()/2,theight,">Help<" : inc theight,otheight*2
else
center text screen width()/2,theight,"Help" : inc theight,otheight*2
endif
if upkey() and upbuffer=0 then dec selecteditem : upbuffer=15
if downkey() and downbuffer=0 then inc selecteditem : downbuffer=15
if selecteditem>2 then selecteditem=1
if selecteditem<1 then selecteditem=2
if returnkey()
if selecteditem=1 then goto game
if selecteditem=2 then goto help
endif
if downbuffer>0 then dec downbuffer
if upbuffer>0 then dec upbuffer
sync
loop
help:
cls
theight=0
center text screen width()/2,theight,"Help" : inc theight,otheight*2
sleep 800
printslowly(0,theight,"In the game, use the up and down arrows to position yourself as you walk",1) : inc theight,otheight
printslowly(0,theight,"across the planet. Use the spacebar to fire lasers at the creatures.",1) : inc theight,otheight
printslowly(0,theight,"Since you are supposed to kill all of the creatures, you are only allowed",1) : inc theight,otheight
printslowly(0,theight,"to let 9 creatures get past you. If a creature hits you, you",1) : inc theight,otheight
printslowly(0,theight,"lose health. The object of the game is to kill as many creatures as you can.",1) : inc theight,otheight
printslowly(0,theight,"You may come across certain powerups, such as bombs, which clear the room of",1) : inc theight,otheight
printslowly(0,theight,"creatures when you press B, and health packs, which raise your health. Have Fun!",1) : inc theight,otheight*2
sleep 800
printslowly(0,theight,"Press any key to continue.",1) : inc theight,otheight
wait key
goto menu
game:
dim colors(numcolors)
p_y=screen height()/2
bgcol = rgb(111,183,255)
Dim enemies(numenemiesatatime,3) :`1=x 2=y 3=type (3-eye or 4-bat)
Dim shots(maxshots,3) :`1=x 2=y 3=on/off
curshots=0
curpu=0
health=100
escaped=0
killed=0
bombs=0
pu_x = screen width()
pu_y = rnd(screen height())
pu_num=5
e_speed#=initialenemyspeed#
gosub _setup
gosub _drawinitial
do
cls
gosub _enemies
if curpu<maxpowerupsatatime
r=rnd(1000)
if r=1
pu_num=5
inc curpu
pu_x = screen width()
pu_y = rnd(screen height())
sprite 21,pu_x,pu_y,pu_num
scale sprite 21,200
endif
if r=2
pu_num=6
inc curpu
pu_x = screen width()
pu_y = rnd(screen height())
sprite 21,pu_x,pu_y,pu_num
scale sprite 21,200
endif
endif
if curpu>0
dec pu_x,5
sprite 21,pu_x,pu_y,pu_num
endif
inc e_speed#,0.001
if upkey() then dec p_y,5
if downkey() then inc p_y,5
if curshots>0
for i=1 to maxshots
if shots(i,3)=1
shots(i,1)=shots(i,1)+5
if shots(i,1) < screen width()
sprite i+1,shots(i,1),shots(i,2),2
s_hit=sprite collision(i+1,0)
if s_hit>9 and s_hit<20
delete sprite i+1
shots(i,3)=0
delete sprite s_hit
inc killed
dec curshots
enemies(s_hit-10,2)=rnd(screen height())
enemies(s_hit-10,1)=screen width()
enemies(s_hit-10,3)=rnd(numenemies-1)+3
endif
else
delete sprite i+1
shots(i,3)=0
dec curshots
endif
endif
next i
endif
if spacekey() and spacesep=0 and curshots<maxshots
inc curshots
spacesep=15
for i=1 to maxshots
if shots(i,3)=0
tshot=i
goto handleshot
endif
next i
handleshot:
shots(tshot,2)=p_y+16
shots(tshot,1)=36
sprite tshot+1,shots(tshot,1),shots(tshot,2),2
scale sprite tshot+1,400
shots(tshot,3)=1
endif
p_hit=sprite collision(1,0)
if p_hit>9 and p_hit<20
dec health,10
cls rgb(255,0,0)
sync
endif
if p_hit>19
delete sprite p_hit
dec curpu
if p_hit=21
if pu_num=5 and bombs<maxbombs then inc bombs,3
if bombs>maxbombs then bombs=maxbombs
if pu_num=6 and health<100 then inc health,25
if health>100 then health=100
endif
endif
if bombs>0 and scancode()=48 and bombsep=0
bombsep=20
dec bombs
for i=1 to numenemiesatatime
delete sprite i+10
enemies(i,2)=rnd(screen height())
enemies(i,1)=screen width()
enemies(i,3)=rnd(numenemies-1)+3
inc killed
next i
cls rgb(255,255,0)
sync
wait 100
cls bgcol
sync
endif
if spacesep>0 then dec spacesep
if bombsep>0 then dec bombsep
sprite 1,0,p_y,1
if escaped>maxescaped then goto finish_toomanyescaped
if health<=0 then goto finish_die
ink 0,bgcol
text 0,0,"Health: "+str$(health)
text 0,otheight,"Killed: "+str$(killed)
text 0,otheight*2,"Escaped: "+str$(escaped)
if bombs>0 then text 0,otheight*3,"Bombs: "+str$(bombs)
sync
loop
_setup:
restore data_colors
for i=1 to numcolors
read r,g,b
colors(i)=rgb(r,g,b)
next i
for drawings = 1 to numdrawings
select drawings
case 1
restore data_man
endcase
case 2
restore data_shot
endcase
case 3
restore data_enemy_eye
endcase
case 4
restore data_enemy_bat
endcase
case default
end
endcase
endselect
read tox,toy
create bitmap 1,tox+1,toy+1
set current bitmap 1
cls bgcol
for y=1 to toy
for x=1 to tox
read colnum
ink colors(colnum),bgcol
dot x,y
next x
next y
get image drawings,1,1,tox+1,toy+1
delete bitmap 1
remstart
for y=0 to toy-1
for x=0 to tox-1
read colnum
ink colors(colnum),bgcol
`dot x,y
box x*4,y*4,(x+1)*4,(y+1)*4
sync
wait 100
next x
next y
get image drawings,1,1,tox*4,toy*4
remend
next drawings
`generate powerup sprites (so simple they can be drawn)
`bomb
cls
tlength = text height("B")+5
midtlength = tlength/2
ink colors(3),0
circle midtlength,midtlength,midtlength-1
ink colors(1),0
center text midtlength,midtlength-(text height("B")/2),"B"
get image 5,0,0,tlength,tlength
`health
cls
tlength = text height("+")+5
midtlength = tlength/2
ink colors(9),0
circle midtlength,midtlength,midtlength-1
ink rgb(255,0,0),0
center text midtlength,midtlength-(text height("+")/2),"+"
get image 6,0,0,tlength,tlength
for i=1 to numenemiesatatime
enemies(i,2)=rnd(screen height())
enemies(i,1)=screen width()
enemies(i,3)=rnd(numenemies-1)+3
next i
return
_drawinitial:
set current bitmap 0
cls bgcol
sprite 1,0,p_y,1
scale sprite 1,400
return
_enemies:
for i=1 to numenemiesatatime
`enemies(i,1)=screen width()
enemies(i,1)=enemies(i,1)-e_speed#
sprite i+10,enemies(i,1),enemies(i,2),enemies(i,3)
if enemies(i,1)<0
inc escaped
enemies(i,2)=rnd(screen height())
enemies(i,1)=screen width()
enemies(i,3)=rnd(numenemies-1)+3
endif
scale sprite i+10,400
next i
remstart
dec e_x,3
sprite 3,e_x,e_y,3
if e_x<0
e_y=rnd(screen height())
e_x=screen width()
endif
scale sprite 3,400
remend
return
finish_toomanyescaped:
hide all sprites
cls 0
sync
theight=0
printslowly(0,theight,"You let too many creatures escape!",0) : inc theight,otheight
if killed>0
if killed=1 then str$="But not before you killed 1 creature!"
if killed>1 then str$="But not before you killed "+str$(killed)+" creatures!"
printslowly(0,theight,str$,0) : inc theight,otheight
endif
sleep 1000
printslowly(0,theight,"Press any key to restart or [ESC] to exit.",0)
wait key
goto intro
end
finish_die:
hide all sprites
cls 0
sync
theight=0
printslowly(0,theight,"You died!",0) : inc theight,otheight
if killed>0
if killed=1 then str$="But not before you killed 1 creature!"
if killed>1 then str$="But not before you killed "+str$(killed)+" creatures!"
printslowly(0,theight,str$,0) : inc theight,otheight
endif
sleep 1000
printslowly(0,theight,"Press any key to restart or [ESC] to exit.",0)
wait key
goto intro
end
end
data_colors:
data 70,35,0 :`1-dark brownish-black
data 170,85,0 :`2-light brown
data 253,221,111 :`3-fleshy
data 0,255,128 :`4-bright green
data 0,0,255 :`5-blue
data 128,128,128 :`6-gray
data 255,255,0 :`7-yellow
`data 255,255,185 :`8-shot edges light yellow
data 164,210,161 :`8-semi transparent (virtually) yellow
data 255,255,255 :`9-white
data_man:
remstart version 1
data 9,13
data 0,0,2,2,2,2,0,0,0
data 0,0,3,3,3,1,0,0,0
data 0,0,3,3,3,3,0,0,0
data 0,0,0,3,3,0,0,0,0
data 3,4,5,4,4,5,4,0,0
data 3,4,5,4,4,5,4,0,0
data 4,4,5,4,4,5,6,6,6
data 4,4,5,4,4,5,6,3,0
data 3,4,5,4,4,5,4,0,0
data 0,5,5,5,5,5,5,0,0
data 0,5,5,5,5,5,5,0,0
data 1,1,1,0,0,1,1,1,0
data 1,1,1,0,0,1,1,1,0
remend
data 9,12
data 0,2,2,2,2,0,0,0,0
data 0,3,3,3,1,0,0,0,0
data 0,3,3,3,3,0,0,0,0
data 0,0,3,3,0,0,0,0,0
data 4,5,4,4,5,4,0,0,0
data 4,5,4,4,5,6,6,6,6
data 4,5,4,4,5,6,3,0,3
data 4,5,4,4,5,4,0,0,0
data 5,5,5,5,5,5,0,0,0
data 5,5,5,5,5,5,0,0,0
data 1,1,1,0,1,1,1,0,0
data 1,1,1,0,1,1,1,0,0
data_shot:
data 6,3
data 0,0,8,8,8,0
data 8,7,7,7,7,8
data 0,0,8,8,8,0
data_enemy_eye:
data 9,9
data 0,0,0,4,4,4,0,0,0
data 0,4,4,0,0,0,4,4,0
data 0,4,0,0,0,2,0,4,0
data 4,9,9,0,2,0,0,0,4
data 4,1,9,0,0,2,2,0,4
data 4,9,9,0,0,0,0,2,4
data 0,4,0,0,2,2,0,4,0
data 0,4,4,2,0,0,4,4,0
data 0,0,0,4,4,4,0,0,0
data_enemy_bat:
data 15,4
data 0,1,1,1,1,0,1,1,1,0,1,1,1,1,0
data 1,0,0,0,0,1,5,1,5,1,0,0,0,0,1
data 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0
data 0,0,0,0,0,0,9,0,9,0,0,0,0,0,0
````FUNCTIONS
function printslowly(x,y,fullstr$,exitonkeypress)
ink rgb(0,255,0),0
`set text size,
for i = 1 to len(fullstr$)
if scancode()>0 and exitonkeypress
text x,y,fullstr$
exitfunction
endif
text x,y,left$(fullstr$,i)
if scancode()>0 and exitonkeypress
text x,y,fullstr$
exitfunction
endif
sleep 100
if scancode()>0 and exitonkeypress
text x,y,fullstr$
exitfunction
endif
next i
endfunction
It uses a bit from LBFN's code. Try it out!
It's a bit messy code, but I was up all night writing it, so meh...
@sinani - I'm just thinking it'd be so much easier if you used phaelax's code, because otherwise everything would have to be done manually. Do you want to host on my site?
I have had experience in html,php,css,and mysql. If you want, I'll do the layout of the site, so you can focus on moving the content over from phaelax's database. If you host it on my website, you can use my database, since I don't know if bravenet has one for your bravehost account. If you are serious about doing a site, do a serious site that looks good.