here is the new 'supreme' version with online high score table!
Download it!
Click To View Current High Scores
this is Diceteroids,
a game programmed in 8 hours,
using free media from
http://forum.thegamecreators.com/?m=forum_view&t=85024&b=4
It was inspired by David Gervais's Dice Challenge,
http://forum.thegamecreators.com/?m=forum_view&t=172821&b=1
here is a youtube video of some high-level play:
http://www.youtube.com/watch?v=0zJa3eCd9s8
controls:
(now also with XBOX 360 controller support)
left and right arrowkeys turn your ship.
spacekey and control keys fire
up arrow key adds thrust, allowing you to move around.
[P] - Pause
[W] - Toggle window size
[Z] - Shield
i have upgraded to
Diceteroids! Supreme
Download it!
New Features:
* Now With Sound! (toggle on/off with 'S' key)
* Now with support for XBOX 360 Controller. A to fire, Right Bumper To Thrust
* a defenseive shield ( Z key or 'X' button )
* Reverse Thrust (Down Arrow or Left Bumper)
* 8 kinds of POWER-UPS with 3 or more levels of each
* an alien saucer that shoots
* Red Diceteroids are fast
* Blue Diceteroids curve
* Purple Diceteroids can reflect your shots
* Gold Diceteroids break into Silver Cubes, which you can pick up for points
shoot the diceteroids, don't get hit.
Extra Lives at 5000, 10000, 20000, 40000, 60000,...?
.exe with media is attached.
here is the NEW full
` ==== INIT ====
set display mode 640,480,32
sync on
sync rate 0
sync
set window on
set window title "Diceteroids!"
randomize timer()
set text font "lucida console"
set text size 20
ink rgb(255,222,128),0
`ink rgb(22,44,200),0
Hide Mouse
` ==== TYPEs ====
Type Entity
X as float
Y as float
A as float
spd
size
img
thrust as float
frame
color
powerup
Endtype
` ==== DIMs ====
dim n(100) as entity
` 1=you
` 2-9 = your shots
` 10 = Enemy Ship.
` 11 = enemy SHOT
` 15-29 = SILVER CUBES
` 30-65 = DICETEROIDS!
` 70-79 any kind of enemy saucer item.
` 80-89 = explosions (OK to use sprites as long as you move the explosions off screen before checking collision.)
` 91-93 = POWER UPs
` 101 = your shield
` ==== GLOBALs ====
Global GS# as float
Global Exnum
Global ShotNum
Global FT#
Global Wave
Global Score
Global t1
Global Lives
Global Kills
Global Invince#
Global death#
Global XL
Global InputOK
Global WinSize
Global CubeNum
Global ShieldOn
Global PowerUps
Global Shield# as float
Global MissileImage
Global NumShots
Global ShotSpeed
Global FireTime# as float
Global Acceleration# as float
Global Reverse# as float
Global TurnSpeed
Global Sound
Global Pickup$ as string
Global Pickup# as float
Global SaucerTimer# as float
WinSize=640
load_media()
Sound=1
` EACH NEW GAME STARTS HERE:
DO
` ==== DECLARTIONS ====
Exnum=79
ShotNum=1
Wave=0
Score=0
Lives=3
Invince#=0
death#=0
XL=5000
Kills=0
Shield#=30.0 : ` 1
MissileImage=3 : ` 2
NumShots=5 : ` 3
ShotSpeed=13 : ` 4
FireTime#=10.0 : ` 5
Acceleration#=1.35 : ` 6
Reverse#=0.0 : ` 7
TurnSpeed=8 : ` 8
SaucerTimer#=300 : ` 000-(wave*50)
` SaucerTimer#=100 : ` 000-(wave*50)
`Shield#=990.0
`MissileImage=6
`NumShots=9
`ShotSpeed=25
`FireTime#=6.0
`Acceleration#=2.5
`Reverse#=0.75
`TurnSpeed=14
` there are 8 upgrades. in order as above.
for t=1 to 100
clean_entity(t)
next t
DS(1,100)
MENU()
n(1).x=320
n(1).y=240
DO
Start_Wave()
t1=timer()
` ==== MAIN LOOP ====
do
` the game gets faster every wave, and also very slightly for each kill.
gs#=(timer()-t1)*(0.020+(wave/200)) : ` +(Kills/1000)) : ` this causes a freak speed-up at 1000 kills
t1=timer()
paste image 100,0,0
Control_Player()
You_Fire_Shots()
Control_Diceterois()
if wave>1
if sprite exist(10)=0
dec SaucerTimer#,gs#
if SaucerTimer#<1
Spawn_Alien()
SaucerTimer#=rnd(200)+250-(wave*10)
endif
endif
endif
Control_Alien()
Control_Alien_Shot()
Control_Your_Shots()
Control_Silver_Cubes()
Collide_With_Diceteroids()
Extra_Life()
Control_Explosions()
Center_Sprites()
HUD()
sync
IF End_Of_Level()
EXIT
ENDIF
loop
` end of main loop
DS(2,101)
IF LIVES<0
EXIT
ENDIF
LOOP
Game_Over()
` WHEN THE GAME IS OVER,
` the loop ABOVE EXITS,
` and we come down HERE,
` to circle around back up to the TOP,
` with the menu screen.
LOOP
END
` ==== FUNCTIONs ====
Function load_media()
p1$="Diceteroids/"
load image p1$+"ship6.bmp",1
load image p1$+"ship1.bmp",2
load image p1$+"ship8.bmp",21
load image p1$+"missile5.bmp",3
load image p1$+"missile-1-1.bmp",4
load image p1$+"missile-2-2.bmp",5
load image p1$+"missile-3-3.bmp",6
load image p1$+"silverCube2.bmp",7
`load image p1$+"Crab1.bmp",8
`load image p1$+"Crab2.bmp",9
load image p1$+"saucer copy 2.bmp",8
` load image p1$+"saucer copy 2-2.bmp",9
load image p1$+"AlienShot5.bmp",10
load image p1$+"0-0-1.bmp",11
load image p1$+"0-0-2.bmp",12
load image p1$+"0-0-3.bmp",13
load image p1$+"0-0-4.bmp",14
load image p1$+"0-0-5.bmp",15
load image p1$+"0-0-6.bmp",16
load image p1$+"0-0-7.bmp",17
load image p1$+"0-0-8.bmp",18
load image p1$+"shield.bmp",19
load image p1$+"F-star.bmp",23
Restore Dice_Color_Names
I=29
for t=1 to 6
read a$
for u=1 to 6
inc I
b$=p1$+a$+str$(u)+".png"
load image b$,I
write string 1,b$+" is image # "+str$(i)
next u
next t
load image p1$+"planet_bkg01.png",100
a$=p1$+"explosion32.png"
load image a$,99
Dissect_Image(99,32,32,16,1,80)
Dice_Color_Names:
Data "White_","Green_","Red_","Blue_","Purple_","Yellow_"
for t=1 to 999
if image exist(t)
write string 1,"Image "+str$(t)
endif
next t
load sound p1$+"Explo4.wav",1
load sound p1$+"D1.wav",2
load sound p1$+"x1.wav",3
load sound p1$+"x2.wav",4
load sound p1$+"x3.wav",5
load sound p1$+"x4.wav",6
load sound p1$+"xL1.wav",7
load sound p1$+"srl1.wav",8
load sound p1$+"sau2.wav",9
load sound p1$+"E1.wav",10
load sound p1$+"PU3.wav",11
load sound p1$+"SiC1.wav",12
load sound p1$+"MS1.wav",13
load sound p1$+"SH3.wav",14
load sound p1$+"THR1.wav",15
`load sound p1$+".wav",
`load sound p1$+".wav",
`load sound p1$+".wav",
`load sound p1$+".wav",
for t=1 to 15
set sound volume t,90
next t
Endfunction
Function Extra_Life()
if score>=XL
if XL<20000
XL=XL+XL
else
XL=XL+20000
endif
inc lives
play sound 7
Pickup#=60.0
Pickup$="EXTRA SHIP AWARDED!"
endif
Endfunction
Function HUD()
` text 600,460,str$(SaucerTimer#)
` text 0,0,"FPS : "+ str$(screen fps())
` text 0,10,str$(joystick fire c())
` text 0,20,str$(joystick fire d())
` for t=1 to 32
` text 0,30+t*12,str$(t)+" : "+str$(joystick fire x(t)): ` +" SPRITE EXIST :"+STR$(SPRITE EXIST(T))
` next t
Shadow_Text(320,2,"SCORE")
Shadow_Text(320,22,str$(score))
for t=1 to lives
paste image 23,t*30-28,452,1
next t
if shield#>0
text 0,0,"Shield"
ink rgb(22,44,230),0
box 0,20,shield#,40
endif
if Pickup#>0
dec Pickup#,gs#
Shadow_Text(320,360,Pickup$)
endif
ink rgb(255,222,128),0
for t=91 to 93
if sprite exist(t)
set sprite priority t,(t-90)
endif
next t
Endfunction
Function End_Of_Level()
E=1
for t=30 to 89
if sprite exist(t)
E=0
exit
endif
next t
` you have to kill the ALIEN SHIP to end the level.
if sprite exist(10)
E=0
endif
if lives<0 AND death#<1
E=1
endif
Endfunction E
Function Clean_Entity(n)
n(n).X=0
n(n).Y=0
n(n).A=0
n(n).spd=0
n(n).size=0
n(n).img=0
n(n).thrust=0
n(n).frame=0
n(n).color=0
n(n).powerup=0
Endfunction
Function Spawn_Diceteroid(x,y,num,col)
` if x & y =0 then spawn at random location, hopefully not too near the player.
` num = die # , 1-6
` col = color, 1-6 , white - yellow
write string 1,""
write string 1,"spawning diceteroids"
if Col<2 then Col=1
if Col>5 then Col=6
` col=6
` col=5
SXS=0
IF N=0
for n=30 to 65
if sprite exist(n)=0
Clean_Entity(n)
sxs=1
EXIT
endif
next n
ENDIF
IF SXS=1
if x=0 and y=0
` use both because it is possible to blow up a diceteroid that is on the screen edge
` (its also possible at 0,0 too, but less likely)
repeat
x=rnd(640)
y=rnd(480)
until d2d(x,y,n(1).x,n(1).y)>180
endif
n(n).X=x
n(n).Y=y
n(n).A=rnd(359)
spd=(rnd(8+WAVE)+6)-num
if spd<1 then spd=1
if col=3
` RED diceteroids are much faster, by size
spd=spd+(7-num)
endif
n(n).spd=spd
n(n).img=29+((col-1)*6)+num
n(n).thrust=0
n(n).frame=(rnd(1)*2-1)*(rnd(2)+1)
n(n).color=col
n(n).size=num
sprite n,n(n).x,n(n).y,n(n).img
rotate sprite n,n(n).a
Z=10+n(n).size*10
size sprite n,z,z
show sprite n
ENDIF : ` SXS=1
` function now returns a NUMBER of which sprite the new diceteroid is.
Endfunction n
Function d2d(x,y,a,b)
d#=sqrt( (x-a)*(x-a) + (y-b)*(y-b) )
Endfunction d#
Function Control_Player()
ShieldOn=0
dec death#,gs#
dec invince#,gs#
if death#<1
` turn the ship: (keyboard)
n(1).a=wrapvalue(n(1).a+(rightkey()-leftkey())*gs#*TurnSpeed)
` JOYSTICK :
n(1).a=wrapvalue(n(1).a+((joystick x()>400)-(joystick x()<-400))*gs#*TurnSpeed)
` put thrust here:
Ship_Image=1
if n(1).thrust>50
n(1).thrust=50
endif
if n(1).thrust<-25
n(1).thrust=-25
endif
if n(1).thrust>0
dec n(1).thrust,gs#*0.30
endif
if n(1).thrust<-0.5
inc n(1).thrust,gs#*0.30
endif
if upkey() or joystick fire b() or joystick fire x(5)
inc n(1).thrust,gs# * Acceleration#
Ship_Image=2
if sound playing(15)=0 then play sound 15
endif
if (downkey() or joystick fire x(4)) AND Reverse#>0
dec n(1).thrust,gs# * Reverse#
Ship_Image=21
if sound playing(15)=0 then play sound 15
endif
` if thrusting , then use a different SHIP IMAGE.
n(1).x=n(1).x+sin(n(1).a)*n(1).thrust*0.0115
n(1).y=n(1).y-cos(n(1).a)*n(1).thrust*0.0115
Contain_Entity(1)
` draw your ship:
sprite 1,n(1).x,n(1).y,Ship_Image
rotate sprite 1,n(1).a
set sprite priority 1,1
if (joystick fire c() or Keystate(44)) AND shield#>0 : ` Z key OR X button
sprite 101,n(1).x,n(1).y,19
rotate sprite 101,n(1).a
ShieldOn=1
dec shield#,gs#
if sound playing(14)=0 then play sound 14
else
DS(101,101)
endif
if invince#>0
set sprite alpha 1,(255-(invince#*2))
else
set sprite alpha 1,255
endif
endif
if keystate(31) and inputOK
inputOK=0
Sound=1-Sound
if sound=0
for t=1 to 15
set sound volume t,0
next t
else
for t=1 to 15
set sound volume t,90
next t
endif
endif
if keystate(25) or joystick fire x(7)
PAUSE()
endif
if keystate(17) or joystick fire x(6)
if inputOK
inc WinSize,320
if WinSize>1280
WinSize=640
endif
inputOK=0
set window size WinSize,(WinSize*0.75)
endif
endif
if scancode()=0 and joystick fire x(6)=0
inputOK=1
endif
Endfunction
Function PAUSE()
repeat
until scancode()=0
Shadow_Text(320,200,"PAUSED")
SYNC
` wait key
repeat
until scancode()>0 or joystick fire a()
t1=timer()
Endfunction
Function Control_Diceterois()
for n=30 to 65
if sprite exist(n)
if n(n).color=4
n(n).a=n(n).a+n(n).frame*gs#
endif
n(n).x=n(n).x+(sin(n(n).a))*(0.25*gs#*n(n).spd)
n(n).y=n(n).y-(cos(n(n).a))*(0.25*gs#*n(n).spd)
sprite n,n(n).x,n(n).y,n(n).img
Contain_Entity(n)
P=n(n).powerup
if P>0
sprite p,n(n).x,n(n).y,n(p).img
endif
endif
next n
Endfunction
Function Contain_Entity(n)
if n(n).x<1
n(n).x=640
endif
if n(n).x>640
n(n).x=1
endif
if n(n).y>480
n(n).y=480
n(n).a=wrapvalue(180-n(n).a)
endif
if n(n).y<1
n(n).y=1
n(n).a=wrapvalue(180-n(n).a)
endif
if sprite exist(n)
rotate sprite n,n(n).a
endif
Endfunction
Function Center_Sprites()
for t=1 to 101
if sprite exist(t)
offset sprite t,sprite width(t)/2,sprite height(t)/2
endif
next t
Endfunction
Function Dissect_Image(img,Xsz,Ysz,Xpart,Ypart,Fim)
` image to dissect, x dimension, y dimension, x parts, y parts, make into images starting with #
J=Fim
cls
paste image img,0,0,1
for y=1 to Ypart
for x=1 to Xpart
get image Fim,(x-1)*Xsz,(y-1)*Ysz,(x-1)*Xsz+Xsz,(y-1)*Ysz+Ysz,1
inc Fim
next x
next y
Endfunction
Function Make_Explosion(x,y,z)
inc Exnum
if exnum>89
exnum=80
endif
if z<32
z=32
endif
Clean_Entity(Exnum)
sprite Exnum,x,y,80
rotate sprite Exnum,rnd(359)
size sprite Exnum,z,z
n(Exnum).x=x
n(Exnum).y=y
n(Exnum).img=80
n(exnum).a=0
Endfunction
Function Control_Explosions()
H=1
for n=80 to 89
if sprite exist(n)
inc h
set sprite priority n,h
inc n(n).a,gs#
n(n).img=80+(n(n).a/2)
if n(n).img>95
delete sprite n
else
sprite n,n(n).x,n(n).y,n(n).img
endif
endif
next n
Endfunction
Function Collide_With_Diceteroids()
` check for PICKING UP POWERUPs FIRST
if sprite exist(1)
set sprite priority 1,1
c=sprite collision(1,0)
if c>90 and c<94
if n(c).color=1
Add_Power_Up(n(c).img-10)
play sound 11
DS(c,c)
endif
endif
` now for colliding with the ALIEN or it's SHOT
if invince#<1 and ShieldOn=0
scale sprite 1,50
c=sprite collision(1,0)
if c=10 or c=11
player_dies()
endif
endif
endif
` move existing explosions and POWERUPS away:
for t=80 to 93
if sprite exist(t)
move sprite t,2000
endif
next t
` this collides YOUR SHOTS ONLY.
FOR W=2 TO 9
IF SPRITE EXIST(W)
c=sprite collision(W,0)
if c>29 and c<66
` something has collided with a DICETEROID!
if n(c).color<>5 or rnd(1)=0 : ` purple diceteroids only explode 25% of the time. NEED A SOUND FOR THIS!
N=n(c).color*5
P=(7-n(c).size)
inc score,(P*N)
inc Kills
if kills>999
kills=0
inc lives
play sound 7
Pickup#=60.0
Pickup$="1000 DICETEROIDS DESTROYED!"
endif
play sound rnd(3)+3
Make_Explosion(n(c).x,n(c).y,(10+n(c).size*10))
move sprite Exnum,2000
Divide_Diceteroid(c)
delete sprite w
else
` PLAY SOUND for a purple diceteroid not blowing up.
play sound 10
repeat
n(w).a=rnd(359)
n(W).x=n(W).x+(sin(n(W).a)*5)
n(W).y=n(W).y-(cos(n(W).a)*5)
sprite w,n(W).x,n(W).y,MissileImage
Contain_Entity(W)
until sprite collision(w,c)=0
endif
` delete sprite w
endif
ENDIF
NEXT W
if invince#<1 and ShieldOn=0
size sprite 1,14,16
c=sprite collision(1,0)
if c>29 and c<66
` YOU HAVE COLLIDED WITH A DICETEROID!
hite=sprite height(c)
wide=sprite width(c)
scale sprite c,65
c2=sprite collision(1,c)
if c2
Player_Dies()
endif
if sprite exist(c)
size sprite c,wide,hite
endif
endif
endif
` move existing explosions BACK
for t=80 to 93
if sprite exist(t)
move sprite t,-2000
endif
next t
if sprite exist(1)
size sprite 1,28,32
endif
Endfunction
Function Player_Dies()
dec lives
play sound 1
` make a really big explosion all around your position:
for t=1 to 9
Make_Explosion(n(1).x+sin(t*40)*20,n(1).y+cos(t*40)*20,48)
next t
` delete you and all your shots.
DS(1,9)
DS(101,101)
death#=50
Invince#=125
n(1).x=320
n(1).y=240
n(1).a=0
n(1).thrust=0
` this gets rid of the ALIEN and its SHOT if YOU DIE.
ds(10,11)
` shield is the only power you lose when you die, or you might get some back.
Shield#=30.0
Endfunction
Function Divide_Diceteroid(z)
x=n(z).x
y=n(z).y
n=n(z).size
c=n(z).color
` play sound rnd(3)+3
if C=6 : ` now, all GOLD diceteroids spawn silver cubes
Make_Silver_Cubes(x,y)
endif
P=n(z).powerup
IF N>1
repeat
r=rnd(n-1)+1
if r=n then dec r
if r<1 then r=1
dec n,r
C=rnd(wave)+1
new=spawn_diceteroid(x,y,r,c)
if P>0
n(p).color=1
if new>0
if r>1
if rnd(1)=0
n(new).powerup=P
n(p).color=0
P=0
endif
endif
endif
endif
until n<1
ENDIF
delete sprite z
clean_entity(z)
Endfunction
Function You_Fire_Shots()
inc FT#,gs#
IF INVINCE#<70 : ` this first check says you can't fire right when you come back to life.
if controlkey() or spacekey() or joystick fire a()
` if ft#>((FireTime#)-(WAVE*0.5))
if ft#>(FireTime#)
inc ShotNum
if ShotNum>NumShots
ShotNum=2
endif
ft#=0
play sound 13
Clean_Entity(ShotNum)
n(ShotNum).x=n(1).x
n(ShotNum).y=n(1).y
n(ShotNum).a=n(1).a
n(ShotNum).thrust=0
` this moves the shot away from the player:
n(ShotNum).x=n(ShotNum).x+(sin(n(ShotNum).a)*(gs#*ShotSpeed)*6)
n(ShotNum).y=n(ShotNum).y-(cos(n(ShotNum).a)*(gs#*ShotSpeed)*6)
sprite ShotNum,n(ShotNum).x,n(ShotNum).y,3
rotate sprite ShotNum,n(ShotNum).a
endif
endif
ENDIF
Endfunction
Function Control_Your_Shots()
` you can have up to 4 shots, and they have a RANGE / age stored in THRUST.
for n=2 to 9
if sprite exist(n)
inc n(n).thrust,gs#
if n(n).thrust>70 : ` this is the AGE check.
delete sprite n
Clean_Entity(n)
else
n(n).x=n(n).x+(sin(n(n).a)*(gs#*ShotSpeed))
n(n).y=n(n).y-(cos(n(n).a)*(gs#*ShotSpeed))
sprite n,n(n).x,n(n).y,MissileImage
Contain_Entity(n) : ` this would make your shots WRAP and BOUNCE, like everything else.
if sprite exist(10)
c=sprite collision(n,10)
if c
for t=1 to 3
Make_Explosion(n(10).x+sin(t*120)*10,n(10).y+cos(t*120)*10,48)
next t
DS(10,10)
play sound 2
inc score,500
DS(n,n)
endif
endif
endif
endif
next n
Endfunction
Function MENU()
t=29
for x=1 to 6 : ` X is COLOR
for y=6 to 1 step -1: ` Y is NUMBER
inc T
N=X*5
P=7-y
n(t).x=(260+(t-29)*80)+x*100
n(t).y=(N*P)
n(t).color=X
n(t).size=y
n(t).img=29+((x-1)*6)+y
next y
next x
DX=1
t1=timer()
do
gs#=(timer()-t1)*0.125
t1=timer()
set text size 30
paste image 100,0,0
Shadow_Text(320,100,"DICETEROIDS!")
Shadow_Text(320,320,"Press Any Key To Play")
Shadow_Text(320,440,"Press Escape To Quit")
for t=30 to 65
dec n(t).x,gs#*DX
sprite t,n(t).x,180,n(t).img
Z=10+n(t).size*10
size sprite t,z,z
Shadow_Text((n(t).x),250,str$(n(t).y))
next t
if n(65).x<-40 then DX=-1
if n(30).x>620 then DX=1
Center_Sprites()
sync
if scancode() or joystick fire a()
EXIT
endif
loop
set text size 20
ds(1,101)
Endfunction
Function DS(x,y)
for t=x to y
if sprite exist(t)
delete sprite t
endif
next t
Endfunction
Function Game_Over()
set text size 30
ds(1,101)
paste image 100,0,0
Shadow_Text(320,120,"GAME OVER")
Shadow_Text(320,230,"FINAL SCORE:")
Shadow_Text(320,270,str$(score))
Shadow_Text(320,370,"Press Any Key To Play Again")
Shadow_Text(320,440,"Press Escape To Quit")
sync
wait 1000
repeat
until scancode() or joystick fire a()
` this keeps the current keypress from being accepted elsewhere:
repeat
until scancode()=0 and joystick fire a()=0
set text size 20
Endfunction
Function Start_Wave()
DS(2,101)
set text size 30
if sprite exist(1) then hide sprite 1
inc WAVE
n(1).thrust=0
cls
paste image 100,0,0
Shadow_Text(320,120,"WAVE "+STR$(WAVE))
Shadow_Text(320,440,"Bonus Ship At "+STR$(XL)+" Points")
Shadow_Text(320,300,"Get Ready!")
sync
wait 2500
N=2+wave
if n>10
n=10
endif
for t=1 to N
Spawn_Diceteroid(0,0,6,rnd(wave)+1)
next t
Attach_Powerups_To_Diceteroids()
if sprite exist(1) then show sprite 1
set text size 20
t1=timer()
Endfunction
Function Attach_Powerups_To_Diceteroids()
PowerUps=(1+(wave>1)+(wave>2))
for pass=1 to PowerUps
fail=0
repeat
x=rnd(7)+1
yes=Is_PowerUp_Needed(x)
inc fail
until yes=1 or fail>100
fail=0
repeat
sxs=0
P=pass+90
` 30-65 - diceteroids!
n=rnd(35)+30
if sprite exist(n)
if n(n).powerup=0
` we have found a diceteroid that does NOT have a powerup attached already.
n(n).powerup=P
n(p).img=x+10
n(p).color=0
sprite p,n(n).x,n(n).y,n(p).img
sxs=1
endif
endif
inc fail
until sxs=1 or fail>500
next pass
Endfunction
` it is possible that GOLD asteroids SHOULD BE PICKED UP,
` and either reflect your shots and are indestructible,
` OR you can destroy them but shouldn't.
` RED asteroids might have a dangerous, extra large explosion, or make DEADLY DEBRIS.
` green asteroids might be completely indestructible,
` OR they need to bump into other asteroids to break
` (or GREEN might be very FRAGILE, and are destroyed if they hit other Diceteroids)
` Purple diceteroids may only have a 50% CHANCE of blowing up when you shoot them.
` Da` ta "White_","Green_","Red_","Blue_","Purple_","Yellow_"
` POINTS are (7-size)*25 + color_bonus =
` WHITE - normal ; color_bonus = 50
` GREEN - fragile, break into twice as many. color_bonus = 75
` RED - debris attack ; color_bonus = 100
` PURPLE - only 50% chance of being destroyed color_bonus = 150
` YELLOW - only worth points if you PICK THEM UP color_bonus = 250
` BLUE - normal, but FAST (or curve) color_bonus = 125
` yellow : you can ONLY pick up the # 1's (smallest). larger must be shot.
` BLUE diceteroids could SLOWLY CURVE THEIR ANGLEs.
` red dice might spawn ALIENS.
` give a COMPLETION TIME BONUS.
` score points
` die
` specific LEVELS
` DICE SPECIAL ABILITIES
` the FIRST VERSION of the game should have these features:
` all dice colors are RANDOM.
` no dice abilities.
` straight forward level advancement.
` * one more diceteroid to start on each level.
` * +1 speed to all diceteroids on each level.
` a title screen and the ability to play repeatedly.
` POSSIBLY ALLOW TO ADJUST RESOLUTION.
` show what power-ups you have when you PAUSE,
` and between LEVELS.
` POWER-UPS
` ---------
` ACCELERATE FASTER 1,2
` REVERSE THRUST 1,2
` TURN FASTER 1,2
` 2 MISSILE, 3 MISSILE, 4 MISSILE
` FIRE MORE SHOTS 1,2,3
` SHOT SPEED 1,2 / MISSILE ENGINE
` RELOAD FASTER 1,2
` SHIELD (powered) ; left bumper
` needs POWER BAR
` power-ups COULD be born attached to diceteroids
Function Add_Power_Up(x)
select X
case 1
shield#=shield#+45.0
endcase
case 2
inc MissileImage
if MissileImage>6
MissileImage=6
endif
endcase
case 3
inc NumShots
if NumShots>9
NumShots=9
endif
endcase
case 4
inc ShotSpeed,4
if ShotSpeed>25
ShotSpeed=25
endif
endcase
case 5
FireTime#=FireTime#-1.0
if FireTime#<6.0
FireTime#=6.0
endif
endcase
case 6
inc Acceleration#,0.38
if Acceleration#>2.5
Acceleration#=2.5
endif
endcase
case 7
inc Reverse#,0.25
if Reverse#>0.75
Reverse#=0.75
endif
endcase
case 8
inc TurnSpeed
if TurnSpeed>14
TurnSpeed=14
endif
endcase
endselect
restore PowerUp_PickUp_Desc
for t=1 to x
read a$
next t
Global Pickup$=a$
Global Pickup#=60.0
Endfunction
PowerUp_PickUp_Desc:
data "Extra Shield Power!","More Firepower!","Greater Missile Payload!","Faster Missiles!"
data "Quicker Reload!","More Acceleration!","Reverse Thrust!","Faster Turning!"
Function Is_PowerUp_Needed(x)
yes=0
select X
case 1
if shield#<100
Yes=1
endif
endcase
case 2
if MissileImage<6
Yes=1
endif
endcase
case 3
if NumShots<9
Yes=1
endif
endcase
case 4
if ShotSpeed<25
Yes=1
endif
endcase
case 5
if FireTime#>6.0
Yes=1
endif
endcase
case 6
if Acceleration#<2.5
Yes=1
endif
endcase
case 7
if Reverse#<0.75
Yes=1
endif
endcase
case 8
if TurnSpeed<14
Yes=1
endif
endcase
endselect
Endfunction Yes
Function Make_Silver_Cubes(x,y)
thrust=7+rnd(4)
for t=1 to 3
inc CubeNum
if CubeNum<15 or CubeNum>29
CubeNum=15
endif
n(CubeNum).x=x
n(CubeNum).y=y
n(CubeNum).a=rnd(359)
N(CubeNum).THRUST=thrust
sprite CubeNum,n(CubeNum).x,n(CubeNum).y,7
next t
Endfunction
Function Control_Silver_Cubes()
` silver cubes are small, fast items that come out of diceteroid explosions. (GOLD)
` they do NOT wrap/bounce.
for t=15 to 29
if sprite exist(t)
DEC N(T).THRUST,GS#*0.20
IF N(T).THRUST<0.5
N(T).THRUST=0.5
ENDIF
n(t).x=n(t).x+(sin(n(t).a))*(0.75*gs#*N(T).THRUST)
n(t).y=n(t).y-(cos(n(t).a))*(0.75*gs#*N(T).THRUST)
sprite t,n(t).x,n(t).y,7
if n(t).x<-10 or n(t).y<-10 or n(t).x>700 or n(t).y>500
delete sprite t
endif
if sprite exist(1) AND sprite exist(t)
if sprite collision(t,1)
inc score,100
play sound 12
delete sprite t
endif
endif
endif
next t
Endfunction
Function Shadow_Text(x,y,a$)
ink rgb(26,13,13),0
center text x+3,y,a$
ink rgb(255,222,128),0
center text x,y-3,a$
Endfunction
Function Control_Alien()
a=10
If sprite exist(a)
if sound looping(9)=0
loop sound 9
endif
dec n(a).thrust,gs#
if n(a).thrust<1
n(a).frame=1-n(a).frame
n(a).thrust=10
inc n(a).spd
if n(a).spd>7
n(a).a=rnd(359)
n(a).spd=0
endif
endif
n(a).x=n(a).x+(sin(n(a).a))*(gs#*5)
n(a).y=n(a).y-(cos(n(a).a))*(gs#*5)
Contain_Entity(a)
sprite a,n(a).x,n(a).y,8 : ` +n(a).frame
rotate sprite a,0
if n(a).x<-10 or n(a).y<-10 or n(a).x>700 or n(a).y>500
delete sprite a
endif
Else
stop sound 9
Endif
Endfunction
Function Control_Alien_Shot()
a=11
if sprite exist(a)
n(a).x=n(a).x+(sin(n(a).a))*(gs#*11)
n(a).y=n(a).y-(cos(n(a).a))*(gs#*11)
sprite a,n(a).x,n(a).y,10
rotate sprite a,n(a).a
c=sprite collision(a,0)
if c>29 and c<66
` the ALIEN shot a DICETEROID!
n(a).x=-999
Make_Explosion(n(c).x,n(c).y,(10+n(c).size*10))
Divide_Diceteroid(c)
ds(c,c)
endif
if n(a).x<-10 or n(a).y<-10 or n(a).x>700 or n(a).y>500
delete sprite a
endif
else
if sprite exist(10)
n(a).x=n(10).x
n(a).y=n(10).y
n(a).a=rnd(359)
sprite a,n(a).x,n(a).y,10
play sound 8
endif
endif
Endfunction
Function Spawn_Alien()
a=10
x=rnd(640)
y=rnd(480)
if rnd(1)=0
if rnd(1)=0
x=5
else
x=635
endif
else
if rnd(1)=0
y=5
else
y=475
endif
endif
sprite a,x,y,8
n(a).a=rnd(359)
n(a).x=x
n(a).y=y
n(a).thrust=10
n(a).spd=0
Endfunction