Project 3 is done!
Blast Invaders. Trust me, it might feel slow in the beginning, but it will pick up, and you will die, lol!
Controls:
left/right - move your ship left and right
space - fire!!
Screen Shot:
Source:
Rem Project: Blast Invaders
Rem Setup Screen goodies
Set Display Mode 800,600,16 : Set Window On
Set Window Layout 3,1,0 : Set Window Title "Blast Invaders V1.0"
Sync Rate 0 : Sync On : Sync Rate 30
Hide Mouse : Autocam Off : Backdrop on : Color Backdrop 0
Set Ambient Light 75
Rem Variables
Score# = 0
Dim Base#(3)
for i = 1 to 3
Base#(i)=1
next i
Enemy_X#=-220
Enemy_Z#=40
Enm_m#=-10
Fire_Rate# = 20
XM_D#=15
Dim Invaders#(10,3)
for y = 1 to 3
for x = 1 to 10
If y=1 then Invaders#(x,y)=1
If y=2 then Invaders#(x,y)=2
If y=3 then Invaders#(x,y)=3
next x
next y
Rem Load Graphics
Rem Enemies
Load Image "enemiesinv01.bmp",1,1
Load Image "enemiesinv02.bmp",2,1
Load Image "enemiesinv03.bmp",3,1
Load Image "enemiesship01.bmp",4,1
Rem Base
Load Image "playerbase01.bmp",5,1
Load Image "playerbase02.bmp",6,1
Load Image "playerbase03.bmp",7,1
Load Image "playerbase04.bmp",8,1
Load Image "playerbase05.bmp",9,1
Load Image "playerbase06.bmp",10,1
Load Image "playerbase07.bmp",11,1
Load Image "playerbase08.bmp",12,1
Rem Player
Load Image "playerplayer01.bmp",13,1
Rem SFX
Load Image "sfxlaser01.bmp",14,1
Load Image "sfxlaser02.bmp",15,1
Rem Sounds
Load Sound "soundinv01.wav",1
Load Sound "soundfire01.wav",2
Load Sound "sounddeath01.wav",3
Load Sound "soundship01.wav",4
Load Sound "soundbase01.wav",5
Rem Create Player and Bases
Rem Player Model
Make Object Plain 1,20,20 : Position Object 1,0,0,-210
Rotate Object 1,90,0,0 : Texture Object 1,13 : Set Object Ambient 1,1
Set object Transparency 1,1 : Set Object Filter 1,0
Rem Center Base
Make Object Plain 2,40,40 : Position Object 2,0,5,-150
Rotate Object 2,90,0,0 : Texture Object 2,5 : Set Object Ambient 2,1
Set object Transparency 2,1 : Set Object Filter 2,0
Rem Left Base
Make Object Plain 3,40,40 : Position Object 3,-190,5,-150
Rotate Object 3,90,0,0 : Texture Object 3,5 : Set Object Ambient 3,1
Set object Transparency 3,1 : Set Object Filter 3,0
Rem Right Base
Make Object Plain 4,40,40 : Position Object 4,190,5,-150
Rotate Object 4,90,0,0 : Texture Object 4,5 : Set Object Ambient 4,1
Set object Transparency 4,1 : Set Object Filter 4,0
Rem Build Monsters and Position
for m = 1 to 3
for n = 1 to 10
model_N#=(((m*10)-10)+(n-1))+100
make object plain model_N#,20,20 : texture object model_N#,Invaders#(n,m)
position object model_N#,Enemy_X#+(n*40),0,Enemy_Z#+(m*40)
rotate object model_N#,90,0,0 : Set Object Ambient model_N#,1
Set object Transparency model_N#,1 : Set Object Filter model_N#,0
next n
next m
Rem Build Space Ship
Make Object Plain 200,20,20 : Texture Object 200,4
Rotate Object 200,90,0,0 : Set Object Ambient 200,1
Set object Transparency 200,1 : Set Object Filter 200,0
Ship_P# = Rnd(1)+1
If Ship_P# = 1 then Position Object 200,600,0,180
If Ship_P# = 2 then Position Object 200,-600,0,180
Rem Camera Position
Position Camera 0,400,0 : Point Camera 0,0,0
REm text
Set Text Size 42
Rem Main Loop
Start:
Do
Rem Print Score
Text 22,22,"Score: "+STR$(Score#)
Rem Enemy Ship Code
Rem Go Left
If Ship_P# = 1
Move Object Left 200,4
If Object Position X(200)<-600 then Ship_P# = 2
Endif
Rem Go Right
If Ship_P# = 2
Move Object Right 200,4
If Object Position X(200)>600 then Ship_P# = 1
Endif
Rem Sounds
If Object In Screen(200) = 1
If Sound Looping(4) = 0 Then Loop Sound 4
Else
Stop Sound 4
Endif
Rem Ship Fires
Ship_dly# = Ship_dly# + 1
If Ship_dly# > 30
Ship_dly# = 0
If Object In Screen(200) = 1
for p = 1 to 30
if object exist(p+200)=0
make object plain p+200,20,20
position object p+200,object position x(200),5,object position z(200)
rotate object p+200,90,0,0 : Texture object p+200,15 : Set Object Ambient P+200,1
Set object Transparency p+200,1 : Set Object Filter p+200,0
Play Sound 2
goto skip_eb
endif
next p
skip_eb:
Endif
Endif
Rem Enemy Ships Fire
for r = 1 to 30
enf_A# = RND(29)+1
if Object Visible(enf_A#+99)=1 then goto end_fc
next r
end_fc:
EN_Fire# = EN_Fire# + 1
If EN_Fire# > Fire_Rate#
EN_Fire# = 0
If Object Visible(enf_A#+99)=1
for p = 1 to 30
if object exist(p+200)=0
make object plain p+200,20,20
position object p+200,object position x(enf_A#+99),5,object position z(enf_A#+99)
rotate object p+200,90,0,0 : Texture object p+200,15 : Set Object Ambient P+200,1
Set object Transparency p+200,1 : Set Object Filter p+200,0
Play Sound 2
goto skip_ec
endif
next p
skip_ec:
Endif
Endif
Rem Update Enemy Bullets
For u = 1 to 30
If Object Exist(u+200)=1
Move Object Down u+200,5
Rem Check for player hit and die
If Object Position X(u+200)>Object Position X(1)-10
If Object Position X(u+200)<Object Position X(1)+10
If Object Position Z(u+200)>Object Position Z(1)-10
If Object Position Z(u+200)<Object Position Z(1)+10
Game_O# = 1
win# = 2
Delete Object u+200
Play Sound 3 : Play Sound 5
Endif
Endif
Endif
Endif
Rem Check For Base Hit
For h = 1 to 3
If Base#(h)<8
If Object Exist(u+200)=1
If Object Position X(u+200)>Object Position X(h+1)-20
If Object Position X(u+200)<Object Position X(h+1)+20
If Object Position Z(u+200)>Object Position Z(h+1)-20
If Object Position Z(u+200)<Object Position Z(h+1)+20
Base#(h)=Base#(h)+1
Delete Object u+200
Play Sound 5
Endif
Endif
Endif
Endif
Endif
Endif
Next h
If Object Exist(u+200)=1
If Object Position z(u+200)<-350 then delete object u+200
Endif
Endif
Next u
Rem Update Base
For h = 1 to 3
Texture Object h+1,Base#(h)+4
Next h
Rem Ship Kill
For s = 1 to 10
If Object Exist(s+20)
If Object Position Z(s+20)>Object Position Z(200)-10
If Object Position Z(s+20)<Object Position Z(200)+10
If Object Position X(s+20)>Object Position X(200)-10
If Object Position X(s+20)<Object Position X(200)+10
Ship_P# = RND(1)+1
If Ship_P# = 1 then Position Object 200,800,0,180
If Ship_P# = 2 then Position Object 200,-800,0,180
Play Sound 3
Score# = Score# + 50
Delete Object s+20
Endif
Endif
Endif
Endif
Endif
next s
Rem Update Monsters and Movement
XM_dly#=XM_dly#+1
If XM_dly#>XM_D#
Enemy_X#=Enemy_X#+Enm_m#
If Enemy_X#<-250 then Enm_m#=10 : Enemy_Z#=Enemy_Z#-10
If Enemy_X#>-180 then Enm_M#=-10 : Enemy_Z#=Enemy_Z#-10
XM_dly#=0
for m = 1 to 3
for n = 1 to 10
model_N#=(((m*10)-10)+(n-1))+100
position object model_N#,Enemy_X#+(n*40),0,Enemy_Z#+(m*40)
next n
next m
Endif
Rem Monster Hit Bases
If Enemy_Z#<-160
for q = 1 to 10
If Invaders#(q,1)>0 then Game_O#=1
win#=2
next q
Endif
If Enemy_Z#<-200
for w = 1 to 10
If Invaders#(w,2)>0 then Game_O#=1
win#=2
next w
Endif
If Enemy_Z#<-240
for e = 1 to 10
If Invaders#(e,3)>0 then Game_O#=1
win#=2
next e
Endif
Rem Kill All Monsters Win
kill_all#=0
For g = 1 to 3
For h = 1 to 10
kill_all#=kill_all#+Invaders#(h,g)
Next h
Next g
If kill_all#=0
Game_O# = 1
win#=1
Endif
Rem Game Over Code
If Game_O# > 0
for y = 1 to 3
for x = 1 to 10
If y=1 then Invaders#(x,y)=1
If y=2 then Invaders#(x,y)=2
If y=3 then Invaders#(x,y)=3
model_N#=(((y*10)-10)+(x-1))+100
Show Object model_N#
next x
next y
Enemy_X#=-220
Enemy_Z#=40
Enm_m#=-10
If win# = 2
for i = 1 to 3
Base#(i)=1
next i
XM_D#=15
else
for i = 1 to 3
Base#(i)=Base#(i)-4
if Base#(i)<1 then Base#(i)=1
next i
XM_D#=XM_D#-1
If XM_D#<5 then XM_D#=5
Endif
for k = 1 to 10
if object exist(k+20)=1 then delete object k+20
next k
for l = 1 to 30
if object exist(l+200)=1 then delete object l+200
next l
Rem Game Over
Game_Over:
If win#=1 then Center Text 400,300,"INCOMING NEXT WAVE!"
If win#=2 then Center Text 400,300,"GAME OVER!"
Center Text 400,350,"Your Score: "+STR$(Score#)
Game_O# = Game_O# + 1
If Game_O# = 100
if win# = 1
Fire_Rate#=Fire_Rate#-2
if Fire_Rate#<2 then Fire_Rate#=2
Endif
if win# = 2 then Score# = 0 : Fire_Rate#=20
Game_O# = 0
Goto Start
Endif
sync
Goto Game_Over
Endif
Rem Player Control
Rem Move
If Rightkey()=1 then Move Object Right 1,5
If Leftkey()=1 then Move Object Left 1,5
Rem Fire
If fire=3
dly=dly+1
If dly=10
dly=0
fire=0
Endif
Endif
If fire=0
If Spacekey()=1
fire=1
Play Sound 2
Endif
Endif
If fire=1
for f = 1 to 10
If Object Exist(f+20) = 0
Make Object Plain f+20,20,20 : Position Object f+20,Object Position x(1),Object Position y(1)+5,Object Position z(1)
Rotate Object f+20,90,0,0 : Texture Object f+20,14 : Set Object Ambient f+20,1
Set object Transparency f+20,1 : Set Object Filter f+20,0
fire=3 : goto no_fire
Endif
next f
Endif
no_fire:
Rem Update Bullets
for k = 1 to 10
If Object Exist(k+20) = 1
Move Object Up k+20,5
If Object Position z(k+20)>350 then Delete Object k+20
Rem Collision And destruction with enemy
For v = 1 to 3
For b = 1 to 10
If Invaders#(b,v)>0
If Object Exist(k+20)
model_K#=(((v*10)-10)+(b-1))+100
If Object Position Z(k+20) > Object Position Z(model_K#)-10
If Object Position Z(k+20) < Object Position Z(model_K#)+10
If Object Position X(k+20) > Object POsition X(model_K#)-10
If Object Position X(k+20) < Object Position X(model_K#)+10
If Invaders#(b,v) = 1 then Score# = Score#+5
If Invaders#(b,v) = 2 then Score# = Score#+10
If Invaders#(b,v) = 3 then Score# = Score#+15
Invaders#(b,v)=0
Delete Object k+20
Hide Object model_K#
Play Sound 3
Endif
Endif
Endif
Endif
Endif
Endif
Next b
Next v
Endif
next k
sync
Loop
and attached game at the bottom. ENJOY!
Post your scores! Want to see how far people get.
I got 4620 points, beat that
BWM
Edit:
TO MODS:
Can you change the title of this thread(if possible) too:
"Blast Classic Arcade Attack Remakes" ? Thanks if you can.
"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."