AppTitle "Vector GFX" .SelectGraphicsMode Print "SELECT GRAPHICS MODE" Print "" Print "1: Fullscreen" Print " Fullscreen helps to avoid slowdown on older" Print " computers, but might not work in Windows" Print " Vista." Print "" Print "2: Windowed" Print " Windowed is slower on many older computers," Print " but should work with any version of Windows" Print " or Mac OS." Print "" Local GFXMode = Input("Graphics mode: ") If GFXMode < 1 Or GFXMode > 2 Print "Please enter 1 or 2." Delay 2000 Cls Locate 0,0 Goto SelectGraphicsMode EndIf Graphics 1024,768,0,GFXMode Global GameStatus = 1,HelpPage = 1 Global StartMessagePrevTime = MilliSecs(),StartMessageColor = 1,StartMessagePrevColor Global MainFont = LoadFont("Courier",32) Global HUDFont = LoadFont("Courier",16) Global TitleFont = LoadFont("Courier",128) Global GFXFont = LoadFont("Arial",400) Global Score,BombScore,LifeScore Global Lives = 3,Level# = .9,LevelUpTimer = MilliSecs() Global LastShotTime = MilliSecs() Global ScreenFlash = False Global LastShapeAt = MilliSecs(),ShapeTimer = 2000,Wave = False,WaveTimer = MilliSecs() Global BlackHoleTimer = MilliSecs(),HelpBlackHoleTimer = MilliSecs(),HelpBlackHoleActive = False Global LevelTick = 30 Global Debug = False,FPS,Frames,LastFrameRate = MilliSecs(),GameFrameTimer = CreateTimer(60) Global I Global PrevTitleBlast = MilliSecs(),TitleBlastGap = Rand(-500,500) ;powerups Global PrevPowerup = MilliSecs(),PowerupGap = Rand(-5000,5000) Global RapidFire,RapidFireTimer = MilliSecs() Global SuperShot,SuperShotTimer = MilliSecs() Global Invincible,InvincibleTimer = MilliSecs() Global DoubleScore,DoubleTimer = MilliSecs() Global Bombs = 3,Blasting = False ;color table Const White = 1 Const Red = 2 Const Orange = 3 Const Yellow = 4 Const Green = 5 Const Cyan = 6 Const Blue = 7 Const Purple = 8 Const Grey = 9 Const Black = 10 ;key scancodes Const EscKey = 1 Const EnterKey = 28 Const ShootUpKey = 17 Const ShootLeftKey = 30 Const ShootDownKey = 31 Const ShootRightKey = 32 Const SpaceBar = 57 Const F1Key = 59 Const F2Key = 60 Const F11Key = 87 Const UpKey = 200 Const LeftKey = 203 Const RightKey = 205 Const DownKey = 208 Type Player Field X#,Y#,XSpeed#,YSpeed#,XAcc#,YAcc#,GravX#,GravY# Field Direction End Type Type Bullet Field SuperBullet Field X#,Y#,XSpeed#,YSpeed# End Type Type Shape Field ShapeType,Frame,Radius Field Hits Field X#,Y#,XSpeed#,YSpeed#,XAcc#,YAcc#,XSpeedLimit#,YSpeedLimit#,GravX#,GravY# End Type Type MiniShape Field ShapeType,Radius Field Frame Field X#,Y#,XSpeed#,YSpeed#,XAcc#,YAcc#,XSpeedLimit#,YSpeedLimit#,GravX#,GravY# End Type Type Blast Field X,Y,Radius End Type Type Frag Field X#,Y#,XSpeed#,YSpeed# Field FragColor End Type Type ScoreHover Field X,Y Field Value$ Field CreationTime End Type Type BlackHole Field Present,Size#,Active,Score Field X#,Y#,XSpeed#,YSpeed#,XAcc#,YAcc# End Type Type Powerup Field PowerupType Field X,Y,Side End Type Global Player.Player = New Player Player\X = GraphicsWidth() / 2 Player\Y = GraphicsHeight() / 2 Player\XAcc = .1 Player\YAcc = .1 Player\Direction = 1 Global Blast.Blast = New Blast Blast\X = Player\X Blast\Y = Player\Y Global BlackHole.BlackHole = New BlackHole BlackHole\X = 0 BlackHole\Y = 0 BlackHole\Present = False BlackHole\Active = False BlackHole\Size = 0 BlackHole\XAcc = .005 BlackHole\YAcc = .005 BlackHole\XSpeed = .1 BlackHole\YSpeed = .1 SeedRnd MilliSecs() SetBuffer BackBuffer() Intro() While Not KeyHit(1) Cls If ScreenFlash = True ClsColor 0,0,0 ScreenFlash = False EndIf Select GameStatus Case 1;title screen If MilliSecs() => PrevTitleBlast + 1000 + TitleBlastGap TitleBlastGap = Rand(-500,500) PrevTitleBlast = MilliSecs() CreateExplosion Rand(GraphicsWidth() - 1),Rand(GraphicsHeight() - 1),250 EndIf UpdateFrags(False) TitleScreen() Case 2;main loop If MilliSecs() => PrevPowerup + 30000 + PowerupGap PrevPowerup = MilliSecs() PowerupGap = Rand(-5000,5000) CreatePowerup Rand(1,4) EndIf If MilliSecs() => LevelUpTimer + 30000;level up every half-minute ;BLITZ GLITCH: if you move/comment/erase the following line, Level will not increase blank = blank + blank If Level < 7.9 Then Level = Level + .5 Wave = True WaveTimer = MilliSecs() LevelUpTimer = MilliSecs() EndIf If Wave = True ShapeTimer = 50 Else ShapeTimer = 2000 EndIf If MilliSecs() => LastShapeAt + ShapeTimer LastShapeAt = MilliSecs() CreateShape() EndIf If MilliSecs() => WaveTimer + 3000 Or KeyHit(SpaceBar) Wave = False EndIf LevelTick = 30 - ((MilliSecs() - LevelUpTimer) / 1000) If MilliSecs() => RapidFireTimer + 1000 And RapidFire > 0 RapidFireTimer = MilliSecs() RapidFire = RapidFire - 1 EndIf If MilliSecs() => SuperShotTimer + 1000 And SuperShot > 0 SuperShotTimer = MilliSecs() SuperShot = SuperShot - 1 EndIf If MilliSecs() => InvincibleTimer + 1000 And Invincible > 0 InvincibleTimer = MilliSecs() Invincible = Invincible - 1 EndIf If MilliSecs() => DoubleTimer + 1000 And DoubleScore > 0 DoubleTimer = MilliSecs() DoubleScore = DoubleScore - 1 EndIf If MilliSecs() => BlackHoleTimer + 45000 If Wave = False And BlackHole\Present = False BlackHoleTimer = MilliSecs() BlackHole\Present = True BlackHole\Active = False BlackHole\Size = 1 BlackHole\Score = 500 Repeat BlackHole\X = Rand(312,712) BlackHole\Y = Rand(184,584) Until Distance(BlackHole\X,BlackHole\Y,Player\X,Player\Y) > 50 EndIf EndIf UpdatePlayer() UpdatePowerups() UpdateShapes() UpdateMiniShapes() UpdateBlackHole() UpdateBullets() UpdateFrags() UpdateScoreHovers() DrawArena();this must stay last If KeyHit(25) While Not KeyHit(25) Or KeyHit(1) Cls DrawArena() VectorColor Rand(0,9) SetFont MainFont Text GraphicsWidth() / 2,GraphicsHeight() / 2,"PAUSED",True,True Flip Wend EndIf If KeyHit(1) GameStatus = 1 EndIf Case 3 Help() UpdateShapes(False) For Shape.Shape = Each Shape Delete Shape Next End Select If KeyHit(F11Key) If Debug = False Debug = True Else Debug = False EndIf EndIf Frames = Frames + 1 If MilliSecs() => LastFrameRate + 1000;update the framerate tracker each second FPS = Frames Frames = 0;reset the counter LastFrameRate = MilliSecs() EndIf WaitTimer GameFrameTimer Flip Wend End Function Intro() Color 0,255,0 SetFont MainFont Text 512,384,"Adam Novagen presents...",True,True Flip Delay 5000 Cls Text 512,384,"... A Gigahertz Games freebie...",True,True Flip Delay 4000 Cls SetFont TitleFont Text 512,100,"Vector",True Flip Delay 1500 Cls Color 255,255,255 Rect 0,0,1024,768 Flip CreateExplosion 290,400,250 For I = 1 To 30;half a second at 60 FPS Cls UpdateFrags(False) Color 0,255,0 SetFont TitleFont Text 512,100,"Vector",True SetFont GFXFont Text 145,400,"G",False,True WaitTimer GameFrameTimer Flip Next Cls Color 255,255,255 Rect 0,0,1024,768 Flip CreateExplosion 512,400,250 For I = 1 To 30 Cls UpdateFrags(False) Color 0,255,0 SetFont TitleFont Text 512,100,"Vector",True SetFont GFXFont Text 145,400,"GF",False,True WaitTimer GameFrameTimer Flip Next Cls Color 255,255,255 Rect 0,0,1024,768 Flip CreateExplosion 750,400,250 For I = 1 To 120 Cls UpdateFrags(False) Color 0,255,0 SetFont TitleFont Text 512,100,"Vector",True SetFont GFXFont Text 145,400,"GFX",False,True WaitTimer GameFrameTimer Flip Next Color 255,255,255 Rect 0,0,1024,768 Flip CreateExplosion 512,400,500 For I = 1 To 120 Cls UpdateFrags(False) TitleScreen() WaitTimer GameFrameTimer Flip Next End Function Function TitleScreen() Color 0,255,0 SetFont TitleFont Text 512,100,"Vector",True SetFont GFXFont Text 145,400,"GFX",False,True StartMessagePrevColor = StartMessageColor If MilliSecs() => StartMessagePrevTime + 100 Repeat StartMessageColor = Rand(1,9) Until StartMessageColor <> StartMessagePrevColor StartMessagePrevTime = MilliSecs() EndIf VectorColor StartMessageColor SetFont MainFont Text 512,600,"Press Enter to start",True,True VectorColor Green Text 512,700,"Press F1 for help, or Esc to quit",True If KeyHit(EnterKey);enter GameStatus = 2 PrevPowerup = MilliSecs() LevelUpTimer = MilliSecs() BlackHoleTimer = MilliSecs() For Frag.Frag = Each Frag Delete Frag Next ElseIf KeyHit(F1Key) GameStatus = 3 FlushKeys For Frag.Frag = Each Frag Delete Frag Next EndIf End Function Function VectorColor(ColorNum) Select ColorNum Case 1;white Color 255,255,255 Case 2;red Color 255,0,0 Case 3;orange Color 255,128,255 Case 4;yellow Color 255,255,0 Case 5;green Color 0,255,0 Case 6;cyan Color 0,255,255 Case 7;blue Color 0,0,255 Case 8;purple Color 255,0,255 Case 9;grey Color 128,128,128 Case 10;black Color 0,0,0 End Select End Function Function DrawArena() SetFont MainFont VectorColor Black Rect 0,0,(GraphicsWidth() - 768) / 2,GraphicsHeight() Rect 768 + ((GraphicsWidth() - 768) / 2),0,(GraphicsWidth() - 768) / 2,GraphicsHeight() VectorColor White Rect (GraphicsWidth() - 768) / 2,0,768,768,0 Text 65,10,"SCORE:",True Text 65,150,"LIVES:",True Text 961,10,"POWERS:",True SetFont HUDFont Text 60,50,Score Text 60,190,Lives Text 961,100,"Rapid Fire:",True Text 961,120,RapidFire,True Text 961,150,"Super Shot:",True Text 961,170,SuperShot,True Text 961,200,"Invincible:",True Text 961,220,Invincible,True Text 961,250,"2x Score:",True Text 961,270,DoubleScore,True Text 961,300,"Bombs:",True Text 961,320,Bombs,True If Debug = True Text 0,220,FPS + " FPS" Text 0,250,"Next Wave In:" Text 0,270,LevelTick Text 0,300,"Wave = " + Wave Text 0,330,"MilliSecs():" Text 0,350,MilliSecs() Text 0,380,"LevelUpTimer:" Text 0,400,LevelUpTimer Text 0,430,"Level = " + Level Text 0,460,"RapidFireTimer:" Text 0,480,RapidFireTimer Text 0,510,"SuperShotTimer:" Text 0,530,SuperShotTimer Text 0,560,"BombScore:" Text 0,580,BombScore Text 0,610,"LifeScore:" Text 0,630,LifeScore If BlackHole\Present = True Text 0,660,"Black Hole" Else Text 0,660,"No Black Hole" EndIf EndIf End Function Function UpdatePlayer() ;update player direction If KeyDown(ShootUpKey) And (Not KeyDown(ShootLeftKey) Or KeyDown(ShootRightKey)) Player\Direction = 1;up ElseIf KeyDown(ShootUpKey) And KeyDown(ShootLeftKey) Player\Direction = 8;up-left ElseIf KeyDown(ShootUpKey) And KeyDown(ShootRightKey) Player\Direction = 2;up-right ElseIf KeyDown(ShootLeftKey) And (Not KeyDown(ShootDownKey) Or KeyDown(ShootUpKey)) Player\Direction = 7;left ElseIf KeyDown(ShootRightKey) And (Not KeyDown(ShootDownKey) Or KeyDown(ShootUpKey)) Player\Direction = 3;right ElseIf KeyDown(ShootDownKey) And (Not KeyDown(ShootLeftKey) Or KeyDown(ShootRightKey)) Player\Direction = 5;down ElseIf KeyDown(ShootDownKey) And KeyDown(ShootLeftKey) Player\Direction = 6;down-left ElseIf KeyDown(ShootDownKey) And KeyDown(ShootRightKey) Player\Direction = 4;down-right EndIf ;update player speed If KeyDown(UpKey) If Player\YSpeed > -3 Then Player\YSpeed = Player\YSpeed - Player\YAcc EndIf If KeyDown(DownKey) If Player\YSpeed < 3 Then Player\YSpeed = Player\YSpeed + Player\YAcc EndIf If KeyDown(LeftKey) If Player\XSpeed > -3 Then Player\XSpeed = Player\XSpeed - Player\XAcc EndIf If KeyDown(RightKey) If Player\XSpeed < 3 Then Player\XSpeed = Player\XSpeed + Player\XAcc EndIf If Not KeyDown(UpKey) Or KeyDown(DownKey) If Player\YSpeed > 0 Player\YSpeed = Player\YSpeed - Player\YAcc ElseIf Player\YSpeed < 0 Player\YSpeed = Player\YSpeed + Player\YAcc EndIf EndIf If Not KeyDown(LeftKey) Or KeyDown(RightKey) If Player\XSpeed > 0 Player\XSpeed = Player\XSpeed - Player\XAcc ElseIf Player\XSpeed < 0 Player\XSpeed = Player\XSpeed + Player\XAcc EndIf EndIf Player\X = Player\X + Player\XSpeed Player\Y = Player\Y + Player\YSpeed ;check for arena collisions If Player\X <= ((GraphicsWidth() - 768) / 2) + 7 Or Player\X => (GraphicsWidth() - 7) - ((GraphicsWidth() - 768) / 2) Player\X = Player\X - (Player\XSpeed + Player\GravX) Player\XSpeed = 0 Player\GravX = 0 EndIf If Player\Y <= 7 Or Player\Y => GraphicsHeight() - 7 Player\Y = Player\Y - (Player\YSpeed + Player\GravY) Player\YSpeed = 0 Player\GravY = 0 EndIf VectorColor White Oval Player\X - 5,Player\Y - 5,11,11,0 Select Player\Direction Case 1;up Line Player\X,Player\Y,Player\X,Player\Y - 8 Case 2;up-right Line Player\X,Player\Y,Player\X + 6,Player\Y - 6 Case 3;right Line Player\X,Player\Y,Player\X + 8,Player\Y Case 4;down-right Line Player\X,Player\Y,Player\X + 6,Player\Y + 6 Case 5;down Line Player\X,Player\Y,Player\X,Player\Y + 8 Case 6;down-left Line Player\X,Player\Y,Player\X - 6,Player\Y + 6 Case 7;left Line Player\X,Player\Y,Player\X - 8,Player\Y Case 8;up-left Line Player\X,Player\Y,Player\X - 6,Player\Y - 6 End Select If RapidFire > 0 If KeyDown(ShootUpKey) Or KeyDown(ShootRightKey) Or KeyDown(ShootLeftKey) Or KeyDown(ShootDownKey) If MilliSecs() => LastShotTime + 50 LastShotTime = MilliSecs() CreateBullet() ;BLITZ GLITCH: if this comment is moved or erased, Blitz generates an "Expecting Expression" error - go figure! EndIf EndIf Else If KeyDown(ShootUpKey) Or KeyDown(ShootRightKey) Or KeyDown(ShootLeftKey) Or KeyDown(ShootDownKey) If MilliSecs() => LastShotTime + 100 LastShotTime = MilliSecs() CreateBullet() EndIf EndIf EndIf If KeyHit(SpaceBar) And Bombs > 0 ClsColor 255,255,255 ScreenFlash = True Bomb() EndIf End Function Function CreateBullet() Bullet.Bullet = New Bullet Bullet\X = Player\X Bullet\Y = Player\Y Select Player\Direction Case 1;up Bullet\YSpeed = -5 Case 2;up-right Bullet\XSpeed = 4 Bullet\YSpeed = -4 Case 3;right Bullet\XSpeed = 5 Case 4;down-right Bullet\XSpeed = 4 Bullet\YSpeed = 4 Case 5;down Bullet\YSpeed = 5 Case 6;down-left Bullet\XSpeed = -4 Bullet\YSpeed = 4 Case 7;left Bullet\XSpeed = -5 Case 8;up-left Bullet\XSpeed = -4 Bullet\YSpeed = -4 End Select If SuperShot > 0 Then Bullet\SuperBullet = True End Function Function UpdateBullets() For Bullet.Bullet = Each Bullet Bullet\X = Bullet\X + Bullet\XSpeed Bullet\Y = Bullet\Y + Bullet\YSpeed If Bullet\SuperBullet = True VectorColor Rand(White,Grey) Else VectorColor Yellow EndIf Rect Bullet\X - 1,Bullet\Y - 1,3,3 If Bullet\X < (GraphicsWidth - 768) / 2 Or Bullet\X > 768 + ((GraphicsWidth() - 768) / 2) Or Bullet\Y < 0 Or Bullet\Y > GraphicsHeight() Delete Bullet EndIf Next End Function Function CreateShape() Local Corner = Rand(1,4) Shape.Shape = New Shape If Level < 3.4 Shape\ShapeType = Rand(1,Level) Else Shape\ShapeType = Rand(Level - 3,Level) EndIf Select Corner Case 1;top left Shape\X = ((GraphicsWidth() - 768) / 2) + 25 Shape\Y = 25 Case 2;top right Shape\X = (GraphicsWidth() - 25) - ((GraphicsWidth() - 768) / 2) Shape\Y = 25 Case 3;bottom right Shape\X = (GraphicsWidth() - 25) - ((GraphicsWidth() - 768) / 2) Shape\Y = GraphicsHeight() - 25 Case 4;bottom left Shape\X = ((GraphicsWidth() - 768) / 2) + 25 Shape\Y = GraphicsHeight() - 25 End Select Select Shape\Shapetype Case 1 Shape\Radius = 6 Shape\Hits = 1 Shape\XAcc = .05 Shape\YAcc = .05 Shape\XSpeedLimit = 1 Shape\YspeedLimit = 1 Case 2 Shape\Radius = 5 Shape\Hits = 1 Shape\XAcc = .1 Shape\YAcc = .1 Shape\XSpeedLimit = 1 Shape\YspeedLimit = 1 Case 3 Shape\Radius = 7 Shape\Hits = 2 Shape\XAcc = .1 Shape\YAcc = .1 Shape\XspeedLimit = 2 Shape\YSpeedLimit = 2 Case 4 Shape\Radius = 8 Shape\Hits = 1 Shape\XAcc = .2 Shape\YAcc = .2 Shape\XSpeedLimit = 2.5 Shape\YSpeedLimit = 2.5 Case 5 Shape\Radius = 5 Shape\Hits = 1 Shape\Frame = 1 Shape\XAcc = .01 Shape\YAcc = .01 Shape\XSpeedLimit = 1 Shape\YSpeedLimit = 1 Case 6 Shape\Radius = 7 Shape\Hits = 1 Shape\XAcc = .1 Shape\YAcc = .1 Shape\XSpeedLimit = 1.5 Shape\YspeedLimit = 1.5 Case 7 Shape\Radius = 5 Shape\Hits = 3 Shape\XAcc = .075 Shape\YAcc = .075 Shape\XSpeedLimit = 1 Shape\YSpeedLimit = 1 Case 8 Shape\Radius = 7 Shape\Hits = 1 Shape\XAcc = .125 Shape\YAcc = .125 Shape\XSpeedLimit = 1.5 Shape\YSpeedLimit = 1.5 End Select End Function Function UpdateShapes(GameActive = True) For Shape.Shape = Each Shape Select Shape\ShapeType Case 1;circles VectorColor Red Oval Shape\X - 5,Shape\Y - 5,11,11,0 If GameActive = True For Bullet.Bullet = Each Bullet If Distance(Bullet\X,Bullet\Y,Shape\X,Shape\Y) < Shape\Radius Shape\Hits = Shape\Hits - 1 Shape\XSpeed = -Shape\XSpeed Shape\YSpeed = -Shape\YSpeed If Shape\Hits <= 0 Or Bullet\SuperBullet = True CreateExplosion Shape\X,Shape\Y,50 If DoubleScore <= 0 Then CreateScoreHover Shape\X,Shape\Y,100 Else CreateScoreHover Shape\X,Shape\Y,200 Delete Shape EndIf If Bullet\SuperBullet = False Delete Bullet EndIf If DoubleScore <= 0 Score = Score + 100 BombScore = BombScore + 100 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 100 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf Else Score = Score + 200 BombScore = BombScore + 200 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 200 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf EndIf Goto NextShape EndIf Next EndIf Case 2;diamonds VectorColor Cyan Line Shape\X,Shape\Y - 5,Shape\X + 5,Shape\Y Line Shape\X + 4,Shape\Y + 1,Shape\X,Shape\Y + 5 Line Shape\X - 1,Shape\Y + 4,Shape\X - 5,Shape\Y Line Shape\X - 4,Shape\Y - 1,Shape\X - 1,Shape\Y - 4 If GameActive = True For Bullet.Bullet = Each Bullet If Distance(Bullet\X,Bullet\Y,Shape\X,Shape\Y) < Shape\Radius Shape\Hits = Shape\Hits - 1 Shape\XSpeed = -Shape\XSpeed Shape\YSpeed = -Shape\YSpeed If Shape\Hits <= 0 Or Bullet\SuperBullet = True CreateExplosion Shape\X,Shape\Y,50 If DoubleScore <= 0 Then CreateScoreHover Shape\X,Shape\Y,200 Else CreateScoreHover Shape\X,Shape\Y,400 Delete Shape EndIf If Bullet\SuperBullet = False Delete Bullet EndIf If DoubleScore <= 0 Score = Score + 200 BombScore = BombScore + 200 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 200 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf Else Score = Score + 400 BombScore = BombScore + 400 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 400 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf EndIf Goto NextShape EndIf Next EndIf Case 3;greenie meanies ^_^ VectorColor Green Line Shape\X,Shape\Y - 6,Shape\X + 6,Shape\Y Line Shape\X + 5,Shape\Y + 1,Shape\X,Shape\Y + 6 Line Shape\X - 1,Shape\Y + 5,Shape\X - 6,Shape\Y Line Shape\X - 5,Shape\Y - 1,Shape\X - 1,Shape\Y - 5 Rect Shape\X - 3,Shape\Y - 3,7,7,0 If GameActive = True For Bullet.Bullet = Each Bullet If Distance(Bullet\X,Bullet\Y,Shape\X,Shape\Y) < Shape\Radius Shape\Hits = Shape\Hits - 1 Shape\XSpeed = -Shape\XSpeed Shape\YSpeed = -Shape\YSpeed If Shape\Hits <= 0 Or Bullet\SuperBullet = True CreateExplosion Shape\X,Shape\Y,50 If DoubleScore <= 0 Then CreateScoreHover Shape\X,Shape\Y,300 Else CreateScoreHover Shape\X,Shape\Y,600 Delete Shape EndIf If Bullet\SuperBullet = False Delete Bullet EndIf If DoubleScore <= 0 Score = Score + 300 BombScore = BombScore + 300 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 300 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf Else Score = Score + 600 BombScore = BombScore + 600 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 600 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf EndIf Goto NextShape EndIf Next EndIf Case 4;lightning bolts VectorColor Yellow Line Shape\X + 2,Shape\Y,Shape\X + 5,Shape\Y Line Shape\X + 5,Shape\Y,Shape\X - 4,Shape\Y + 15 Line Shape\X - 4,Shape\Y + 15,Shape\X - 2,Shape\Y Line Shape\X - 2,Shape\Y,Shape\X - 5,Shape\Y Line Shape\X - 5,Shape\Y,Shape\X + 4,Shape\Y - 15 Line Shape\X + 4,Shape\Y - 15,Shape\X + 2,Shape\Y If GameActive = True For Bullet.Bullet = Each Bullet If Distance(Bullet\X,Bullet\Y,Shape\X,Shape\Y) < Shape\Radius Shape\Hits = Shape\Hits - 1 Shape\XSpeed = -Shape\XSpeed Shape\YSpeed = -Shape\YSpeed If Shape\Hits <= 0 Or Bullet\SuperBullet = True CreateExplosion Shape\X,Shape\Y,50 If DoubleScore <= 0 Then CreateScoreHover Shape\X,Shape\Y,400 Else CreateScoreHover Shape\X,Shape\Y,800 Delete Shape EndIf If Bullet\SuperBullet = False Delete Bullet EndIf If DoubleScore <= 0 Score = Score + 400 BombScore = BombScore + 400 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 400 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf Else Score = Score + 800 BombScore = BombScore + 800 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 800 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf EndIf Goto NextShape EndIf Next EndIf Case 5;pulse squares VectorColor Purple Shape\Frame = Shape\Frame + 1 If Shape\Frame > 10 Shape\Frame = 1 Shape\Radius = 5 EndIf Shape\Radius = 5 + Shape\Frame Rect Shape\X - Shape\Radius,Shape\Y - Shape\Radius,Shape\Radius * 2,Shape\Radius * 2,0 If GameActive = True For Bullet.Bullet = Each Bullet If Distance(Bullet\X,Bullet\Y,Shape\X,Shape\Y) < Shape\Radius Shape\Hits = Shape\Hits - 1 Shape\XSpeed = -Shape\XSpeed Shape\YSpeed = -Shape\YSpeed If Shape\Hits <= 0 Or Bullet\SuperBullet = True CreateExplosion Shape\X,Shape\Y,50 If DoubleScore <= 0 Then CreateScoreHover Shape\X,Shape\Y,500 Else CreateScoreHover Shape\X,Shape\Y,1000 Delete Shape EndIf If Bullet\SuperBullet = False Delete Bullet EndIf If DoubleScore <= 0 Score = Score + 500 BombScore = BombScore + 500 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 500 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf Else Score = Score + 1000 BombScore = BombScore + 1000 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 1000 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf EndIf Goto NextShape EndIf Next EndIf Case 6;splitters VectorColor Blue Oval Shape\X - Shape\Radius,Shape\Y - Shape\Radius,Shape\Radius * 2,Shape\Radius * 2,0 Oval Shape\X - (Shape\Radius + 1),Shape\Y - (Shape\Radius + 1),(Shape\Radius * 2) + 2,(Shape\radius * 2) + 2,0 If GameActive = True For Bullet.Bullet = Each Bullet If Distance(Bullet\X,Bullet\Y,Shape\X,Shape\Y) < Shape\Radius Shape\Hits = Shape\Hits - 1 Shape\XSpeed = -Shape\XSpeed Shape\YSpeed = -Shape\YSpeed If Shape\Hits <= 0 Or Bullet\SuperBullet = True CreateExplosion Shape\X,Shape\Y,50 If DoubleScore <= 0 Then CreateScoreHover Shape\X,Shape\Y,600 Else CreateScoreHover Shape\X,Shape\Y,1200 For I = 1 To 4 CreateMiniShape(Shape\X,Shape\Y,1) Next Delete Shape EndIf If Bullet\SuperBullet = False Delete Bullet EndIf If DoubleScore <= 0 Score = Score + 600 BombScore = BombScore + 600 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 600 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf Else Score = Score + 1200 BombScore = BombScore + 1200 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 1200 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf EndIf Goto NextShape EndIf Next EndIf Case 7;stars VectorColor Red Line Shape\X - 6,Shape\Y - 6,Shape\X + 6,Shape\Y + 6 Line Shape\X - 6,Shape\Y + 6,Shape\X + 6,Shape\Y - 6 If GameActive = True For Bullet.Bullet = Each Bullet If Distance(Bullet\X,Bullet\Y,Shape\X,Shape\Y) < Shape\Radius Shape\Hits = Shape\Hits - 1 Shape\XSpeed = -Shape\XSpeed Shape\YSpeed = -Shape\YSpeed If Shape\Hits <= 0 Or Bullet\SuperBullet = True CreateExplosion Shape\X,Shape\Y,50 If DoubleScore <= 0 Then CreateScoreHover Shape\X,Shape\Y,700 Else CreateScoreHover Shape\X,Shape\Y,1400 For I = 1 To 4 CreateMiniShape(Shape\X,Shape\Y,1) Next Delete Shape EndIf If Bullet\SuperBullet = False Delete Bullet EndIf If DoubleScore <= 0 Score = Score + 700 BombScore = BombScore + 700 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 700 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf Else Score = Score + 1400 BombScore = BombScore + 1400 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 1400 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf EndIf Goto NextShape EndIf Next EndIf Case 8;boomers VectorColor Yellow Oval Shape\X - 8,Shape\Y - 3,17,7,0 Oval Shape\X - 3,Shape\Y - 8,7,17,0 If GameActive = True For Bullet.Bullet = Each Bullet If Distance(Bullet\X,Bullet\Y,Shape\X,Shape\Y) < Shape\Radius Shape\Hits = Shape\Hits - 1 Shape\XSpeed = -Shape\XSpeed Shape\YSpeed = -Shape\YSpeed If Shape\Hits <= 0 Or Bullet\SuperBullet = True CreateExplosion Shape\X,Shape\Y,50 If DoubleScore <= 0 Then CreateScoreHover Shape\X,Shape\Y,1000 Else CreateScoreHover Shape\X,Shape\Y,2000 CreateMiniShape(Shape\X,Shape\Y,3) Delete Shape EndIf If Bullet\SuperBullet = False Delete Bullet EndIf If DoubleScore <= 0 Score = Score + 1000 BombScore = BombScore + 1000 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 1000 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf Else Score = Score + 2000 BombScore = BombScore + 2000 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 2000 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf EndIf Goto NextShape EndIf Next EndIf End Select If Player\X < Shape\X If Shape\XSpeed > -Shape\XSpeedLimit Then Shape\XSpeed = Shape\XSpeed - Shape\XAcc ElseIf Player\X > Shape\X If Shape\XSpeed < Shape\XSpeedLimit Shape\XSpeed = Shape\XSpeed + Shape\XAcc EndIf If Player\Y < Shape\Y If Shape\YSpeed > -Shape\YspeedLimit Then Shape\YSpeed = Shape\YSpeed - Shape\YAcc ElseIf Player\Y > Shape\Y If Shape\YSpeed < Shape\YspeedLimit Then Shape\YSpeed = Shape\YSpeed + Shape\YAcc EndIf If BlackHole\Active = True If Shape\X < BlackHole\X Then Shape\GravX = Shape\GravX + .05 If Shape\X > BlackHole\X Then Shape\GravX = Shape\GravX - .05 If Shape\Y < BlackHole\Y Then Shape\GravY = Shape\GravY + .05 If Shape\Y > BlackHole\Y Then Shape\GravY = Shape\GravY - .05 If Distance(Shape\X,Shape\Y,BlackHole\X,BlackHole\Y) <= BlackHole\Size + 10 + Shape\Radius And GameActive = True Delete Shape BlackHole\Size = BlackHole\Size + .5 BlackHole\Score = BlackHole\Score + 100 Goto NextShape EndIf Else Shape\GravX = 0 Shape\GravY = 0 Shape\X = Shape\X + Shape\XSpeed Shape\Y = Shape\Y + Shape\YSpeed EndIf Shape\X = Shape\X + Shape\GravX Shape\Y = Shape\Y + Shape\GravY If Distance(Shape\X,Shape\Y,Player\X,Player\Y) <= Shape\Radius + 7 And Invincible = 0 And GameActive = True Death() Goto NextShape EndIf If Distance(Shape\X,Shape\Y,Blast\X,Blast\Y) <= Blast\Radius + Shape\Radius And Blasting = True And GameActive = True CreateExplosion Shape\X,Shape\Y,50 Select Shape\ShapeType Case 1 If DoubleScore <= 0 Score = Score + 100 BombScore = BombScore + 100 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 100 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,100 Else Score = Score + 200 BombScore = BombScore + 200 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 200 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,200 EndIf Case 2 If DoubleScore <= 0 Score = Score + 200 BombScore = BombScore + 200 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 200 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,200 Else Score = Score + 400 BombScore = BombScore + 400 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 400 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,400 EndIf Case 3 If DoubleScore <= 0 Score = Score + 300 BombScore = BombScore + 300 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 300 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,300 Else Score = Score + 600 BombScore = BombScore + 600 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 600 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,600 EndIf Case 4 If DoubleScore <= 0 Score = Score + 400 BombScore = BombScore + 400 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 400 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,400 Else Score = Score + 800 BombScore = BombScore + 800 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 800 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,800 EndIf Case 5 If DoubleScore <= 0 Score = Score + 500 BombScore = BombScore + 500 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 500 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,500 Else Score = Score + 1000 BombScore = BombScore + 1000 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 1000 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,1000 EndIf Case 6 If DoubleScore <= 0 Score = Score + 600 BombScore = BombScore + 600 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 600 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,600 Else Score = Score + 1200 BombScore = BombScore + 1200 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 1200 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,1200 EndIf Case 7 If DoubleScore <= 0 Score = Score + 700 BombScore = BombScore + 700 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 700 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,700 Else Score = Score + 1400 BombScore = BombScore + 1400 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 1400 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,1400 EndIf Case 8 If DoubleScore <= 0 Score = Score + 1000 BombScore = BombScore + 1000 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 1000 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,1000 Else Score = Score + 2000 BombScore = BombScore + 2000 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 2000 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover Shape\X,Shape\Y,2000 EndIf End Select Delete Shape EndIf .NextShape Next End Function Function CreateMiniShape(MiniShapeX,MiniShapeY,MiniShapeType) Select MiniShapeType Case 1 MiniShape.MiniShape = New MiniShape MiniShape\X = MiniShapeX MiniShape\Y = MiniShapeY MiniShape\ShapeType = MiniShapeType MiniShape\Radius = 5 MiniShape\XAcc = .03 MiniShape\YAcc = .03 MiniShape\XSpeedLimit = 1.5 MiniShape\YSpeedLimit = 1.5 MiniShape\XSpeed = Rand(-MiniShape\XSpeedLimit,MiniShape\XSpeedLimit) MiniShape\YSpeed = Rand(-MiniShape\YSpeedLimit,MiniShape\YSpeedLimit) Case 2 Local anstep# = 360.0 / 20 Local an# = Rnd(anstep) For k = 1 To 20 MiniShape.MiniShape = New MiniShape MiniShape\X = MiniShapeX MiniShape\Y = MiniShapeY MiniShape\Radius = 5 MiniShape\XSpeed = Cos(an) * 2 MiniShape\YSpeed = Sin(an) * 2 MiniShape\ShapeType = 2 an=an+anstep Next Case 3 anstep# = 360.0 / 30 an# = Rnd(anstep) For k = 1 To 30 MiniShape.MiniShape = New MiniShape MiniShape\X = MiniShapeX MiniShape\Y = MiniShapeY MiniShape\Radius = 5 MiniShape\XSpeed = Cos(an) * 2 MiniShape\YSpeed = Sin(an) * 2 MiniShape\ShapeType = 3 an=an+anstep Next End Select End Function Function UpdateMiniShapes() For MiniShape.MiniShape = Each MiniShape Select MiniShape\ShapeType Case 1 VectorColor Cyan Oval MiniShape\X - 4,MiniShape\Y - 4,9,9,0 For Bullet.Bullet = Each Bullet If Distance(MiniShape\X,MiniShape\Y,Bullet\X,Bullet\Y) <= MiniShape\Radius + 1 CreateExplosion(MiniShape\X,MiniShape\Y,25) If DoubleScore <= 0 Score = Score + 100 BombScore = BombScore + 100 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 100 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover MiniShape\X,MiniShape\Y,100 Else Score = Score + 200 BombScore = BombScore + 200 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 200 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover MiniShape\X,MiniShape\Y,200 EndIf Delete MiniShape Goto NextMiniShape EndIf Next Case 2 VectorColor Blue Oval MiniShape\X - 4,MiniShape\Y - 4,9,9,0 Oval MiniShape\X - 3,MiniShape\Y - 3,7,7,0 For Bullet.Bullet = Each Bullet If Distance(MiniShape\X,MiniShape\Y,Bullet\X,Bullet\Y) <= MiniShape\Radius + 1 CreateExplosion(MiniShape\X,MiniShape\Y,25) If DoubleScore <= 0 Score = Score + 150 BombScore = BombScore + 150 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 150 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover MiniShape\X,MiniShape\Y,150 Else Score = Score + 300 BombScore = BombScore + 300 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 300 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover MiniShape\X,MiniShape\Y,300 EndIf Delete MiniShape Goto NextMiniShape EndIf Next Case 3 VectorColor Rand(Red,Purple) Rect MiniShape\X - 3,MiniShape\Y - 3,7,7,0 End Select If Player\X < MiniShape\X If MiniShape\XSpeed > -MiniShape\XSpeedLimit Then MiniShape\XSpeed = MiniShape\XSpeed - MiniShape\XAcc ElseIf Player\X > MiniShape\X If MiniShape\XSpeed < MiniShape\XSpeedLimit MiniShape\XSpeed = MiniShape\XSpeed + MiniShape\XAcc EndIf If Player\Y < MiniShape\Y If MiniShape\YSpeed > -MiniShape\YspeedLimit Then MiniShape\YSpeed = MiniShape\YSpeed - MiniShape\YAcc ElseIf Player\Y > MiniShape\Y If MiniShape\YSpeed < MiniShape\YspeedLimit Then MiniShape\YSpeed = MiniShape\YSpeed + MiniShape\YAcc EndIf MiniShape\X = MiniShape\X + MiniShape\XSpeed MiniShape\Y = MiniShape\Y + MiniShape\YSpeed If BlackHole\Active = True If MiniShape\X < BlackHole\X Then MiniShape\GravX = MiniShape\GravX + .05 If MiniShape\X > BlackHole\X Then MiniShape\GravX = MiniShape\GravX - .05 If MiniShape\Y < BlackHole\Y Then MiniShape\GravY = MiniShape\GravY + .05 If MiniShape\Y > BlackHole\Y Then MiniShape\GravY = MiniShape\GravY - .05 If Distance(MiniShape\X,MiniShape\Y,BlackHole\X,BlackHole\Y) <= BlackHole\Size + 10 + MiniShape\Radius Delete MiniShape BlackHole\Size = BlackHole\Size + .5 BlackHole\Score = BlackHole\Score + 100 Goto NextMiniShape EndIf Else MiniShape\GravX = 0 MiniShape\GravY = 0 EndIf MiniShape\X = MiniShape\X + MiniShape\GravX MiniShape\Y = MiniShape\Y + MiniShape\GravY If Distance(MiniShape\X,MiniShape\Y,Player\X,Player\Y) <= MiniShape\Radius + 7 And Invincible = 0 Death() Goto NextMiniShape EndIf If MiniShape\X < 0 Or MiniShape\X > GraphicsWidth() Or MiniShape\Y < 0 Or MiniShape\Y > GraphicsHeight() Delete MiniShape Goto NextMiniShape EndIf If Distance(MiniShape\X,MiniShape\Y,Blast\X,Blast\Y) <= Blast\Radius + MiniShape\Radius And Blasting = True CreateExplosion MiniShape\X,MiniShape\Y,50 Select MiniShape\ShapeType Case 1 Score = Score + 100 BombScore = BombScore + 100 If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 100 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover MiniShape\X,MiniShape\Y,100 End Select Delete MiniShape EndIf .NextMiniShape Next End Function Function UpdateBlackHole() If BlackHole\Present = True VectorColor Red Oval BlackHole\X - (10 + BlackHole\Size),BlackHole\Y - (10 + BlackHole\Size),20 + (BlackHole\Size * 2),20 + (BlackHole\Size * 2),0 Oval BlackHole\X - (9 + BlackHole\Size),BlackHole\Y - (9 + BlackHole\Size),20 + ((BlackHole\Size * 2) - 2),20 + ((BlackHole\Size * 2) - 2),0 If BlackHole\Active = True VectorColor Cyan Line Rand((GraphicsWidth() - 768) / 2,GraphicsWidth() - ((GraphicsWidth() - 768) / 2)),0,BlackHole\X,BlackHole\Y Line (GraphicsWidth() - 768) / 2,Rand(0,GraphicsHeight() - 1),BlackHole\X,BlackHole\Y Line Rand((GraphicsWidth() - 768) / 2,GraphicsWidth() - ((GraphicsWidth() - 768) / 2)),GraphicsHeight() - 1,BlackHole\X,BlackHole\Y Line GraphicsWidth() - ((GraphicsWidth() - 768) / 2),Rand(0,GraphicsHeight() - 1),BlackHole\X,BlackHole\Y VectorColor White Oval BlackHole\X - (8 + BlackHole\Size),BlackHole\Y - (8 + BlackHole\Size),20 + ((BlackHole\Size * 2) - 4),20 + ((BlackHole\Size * 2) - 4),0 Oval BlackHole\X - (11 + BlackHole\Size),BlackHole\Y - (11 + BlackHole\Size),20 + ((BlackHole\Size * 2) + 2),20 + ((BlackHole\Size * 2) + 2),0 If Player\X < BlackHole\X And Player\GravX < 1 Then Player\GravX = Player\GravX + .005 If Player\X > BlackHole\X And Player\GravX > -1 Then Player\GravX = Player\GravX - .005 If Player\Y < BlackHole\Y And Player\GravY < 1 Then Player\GravY = Player\GravY + .005 If Player\Y > BlackHole\Y And Player\GravY > -1 Then Player\GravY = Player\GravY - .005 Player\X = Player\X + Player\GravX Player\Y = Player\Y + Player\GravY For Bullet.Bullet = Each Bullet If Distance(Bullet\X,Bullet\Y,BlackHole\X,BlackHole\Y) <= BlackHole\Size + 11 CreateExplosion(BlackHole\X,BlackHole\Y,25) BlackHole\Size = BlackHole\Size - .5 If Bullet\SuperBullet = False Delete Bullet EndIf If BlackHole\Size < 0 CreateExplosion(BlackHole\X,BlackHole\Y,150) BlackHole\Active = False BlackHole\Size = 0 BlackHole\Present = False BlackHoleTimer = MilliSecs() If DoubleScore <= 0 Score = Score + BlackHole\Score BombScore = BombScore + BlackHole\Score If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + BlackHole\Score If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover BlackHole\X,BlackHole\Y,BlackHole\Score BlackHole\Score = 500 Else Score = Score + (BlackHole\Score * 2) BombScore = BombScore + (BlackHole\Score * 2) If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + (BlackHole\Score * 2) If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf CreateScoreHover BlackHole\X,BlackHole\Y,BlackHole\Score BlackHole\Score = 500 EndIf EndIf EndIf Next If BlackHole\Size => 20 BlackHole\Active = False BlackHole\Present = False BlackHole\Size = 1 BlackHoleTimer = MilliSecs() CreateExplosion BlackHole\X,BlackHole\Y,500 + (BlackHole\Size * 10) CreateMiniShape BlackHole\X,BlackHole\Y,2 EndIf ElseIf BlackHole\Active = False Player\GravX = 0 Player\GravY = 0 For Bullet.Bullet = Each Bullet If Distance(Bullet\X,Bullet\Y,BlackHole\X,BlackHole\Y) <= 11 Delete Bullet CreateExplosion(BlackHole\X,BlackHole\Y,100) BlackHole\Active = True EndIf Next If BlackHole\Active = True For Bullet.Bullet = Each Bullet Delete Bullet Next EndIf EndIf ;follow the player If Player\X > BlackHole\X And BlackHole\XSpeed < .1 BlackHole\XSpeed = BlackHole\XSpeed + BlackHole\XAcc ElseIf Player\X < BlackHole\X And BlackHole\XSpeed > -.1 BlackHole\XSpeed = BlackHole\XSpeed - BlackHole\XAcc EndIf If Player\Y > BlackHole\Y And BlackHole\YSpeed < .1 BlackHole\YSpeed = BlackHole\YSpeed + BlackHole\XAcc ElseIf Player\Y < BlackHole\Y And BlackHole\YSpeed > -.1 BlackHole\YSpeed = BlackHole\YSpeed - BlackHole\YAcc EndIf BlackHole\X = BlackHole\X + BlackHole\XSpeed BlackHole\Y = BlackHole\Y + BlackHole\YSpeed If Distance(BlackHole\X,BlackHole\Y,Player\X,Player\Y) <= BlackHole\Size + 17 And Invincible <= 0 Death() EndIf If Distance(BlackHole\X,BlackHole\Y,Blast\X,Blast\Y) <= Blast\Radius + BlackHole\Size + 10 And Blasting = True CreateExplosion(BlackHole\X,BlackHole\Y,100 + BlackHole\Size * 10) BlackHole\Active = False BlackHole\Present = False BlackHole\Size = 0 BlackHoleTimer = MilliSecs() Score = Score + BlackHole\Score BombScore = BombScore + BlackHole\Score If BombScore => 50000 Bombs = Bombs + 1 BombScore = BombScore - 50000 EndIf LifeScore = LifeScore + 100000 If LifeScore => 100000 Lives = Lives + 1 LifeScore = LifeScore - 100000 EndIf BombScore = 500 EndIf EndIf End Function Function Distance(Ghz_Lib_Var_Point1X,Ghz_Lib_Var_Point1Y,Ghz_Lib_Var_Point2X,Ghz_Lib_Var_Point2Y) Return Sqr(((Ghz_Lib_Var_Point2X - Ghz_Lib_Var_Point1X) * (Ghz_Lib_Var_Point2X - Ghz_Lib_Var_Point1X)) + ((Ghz_Lib_Var_Point2Y - Ghz_Lib_Var_Point1Y) * (Ghz_Lib_Var_Point2Y - Ghz_Lib_Var_Point1Y))) End Function Function CreateExplosion(ExplosionX,ExplosionY,ExplosionSize) Local count=Rand(ExplosionSize) + ExplosionSize Local anstep# = 360.0 / count Local an# = Rnd(anstep) For k = 1 To count Frag.Frag = New Frag Frag\X = ExplosionX Frag\Y = ExplosionY Frag\XSpeed = Cos(an) * Rnd(6,10) Frag\YSpeed = Sin(an) * Rnd(6,10) an=an+anstep Next End Function Function UpdateFrags(GameActive = True) LockBuffer For Frag.Frag = Each Frag Frag\X = Frag\X + Frag\XSpeed Frag\Y = Frag\Y + Frag\YSpeed blank = blank If GameActive = True If Frag\X <= (GraphicsWidth() - 768) / 2 Or Frag\X => GraphicsWidth() - ((GraphicsWidth() - 768) / 2) Or Frag\Y <= 0 Or Frag\Y => GraphicsHeight() Delete Frag EndIf ElseIf GameActive = False If Frag\X <= 0 Or Frag\X => GraphicsWidth() Or Frag\Y <= 0 Or Frag\Y => GraphicsHeight() Delete Frag EndIf EndIf If Not Frag = Null WritePixelFast Frag\X,Frag\Y,$FFFFFF WritePixelFast Frag\X + 1,Frag\Y + 1,$FFFFFF WritePixelFast Frag\X + 1,Frag\Y,$FFFFFF WritePixelFast Frag\X,Frag\Y + 1,$FFFFFF EndIf Next UnlockBuffer End Function Function Death() For Shape.Shape = Each Shape CreateExplosion(Shape\X,Shape\Y,50) Delete Shape Next For MiniShape.MiniShape = Each MiniShape CreateExplosion(MiniShape\X,MiniShape\Y,25) Delete MiniShape Next For Powerup.Powerup = Each Powerup Delete Powerup Next CreateExplosion(BlackHole\X,BlackHole\Y,40 + (10 * BlackHole\Size)) BlackHole\Active = False BlackHole\Present = False BlackHole\Size = 1 BlackHoleTimer = MilliSecs() BlackHole\Score = 500 For I = 0 To 180;three seconds at 60 FPS Cls UpdateBullets() UpdateFrags() DrawArena() If Lives = 0 VectorColor Rand(White,Black) SetFont TitleFont Text GraphicsWidth() / 2,GraphicsHeight() / 2,"GAME OVER",True,True EndIf Flip Next FlushKeys If Lives = 0 While Not GetKey() VectorColor Rand(White,Black) Text GraphicsWidth() / 2,GraphicsHeight() / 2,"GAME OVER",True,True Flip Wend Score = 0 LifeScore = 0 BombScore = 0 Lives = 4 Bombs = 3 Wave = False WaveTimer = MilliSecs() Level = .9 LevelUpTimer = MilliSecs() GameStatus = 1 FlushKeys TitleScreen() EndIf Lives = Lives - 1 Player\X = GraphicsWidth() / 2 Player\Y = GraphicsHeight() / 2 Player\XSpeed = 0 Player\YSpeed = 0 DoubleScore = 0 RapidFire = 0 SuperShot = 0 BlackHole\Active = False BlackHole\Present = False BlackHole\Size = 1 End Function Function Bomb();the most visually entertaining function in the whole darn game - everyone loves bombs! ^_^ Blast\X = Player\X Blast\Y = Player\Y Blast\Radius = 0 Bombs = Bombs - 1 Blasting = True CreateExplosion Player\X,Player\Y,150 While Blast\Radius < 768 * 2 Cls ClsColor 0,0,0 Blast\Radius = Blast\Radius + 4 UpdatePlayer() UpdatePowerups() UpdateShapes() UpdateMiniShapes() UpdateBlackHole() UpdateBullets() UpdateFrags() VectorColor Rand(White,Grey) Oval Blast\X - Blast\Radius,Blast\Y - Blast\Radius,Blast\Radius * 2,Blast\Radius * 2,0 Oval Blast\X - (Blast\Radius + 1),Blast\Y - (Blast\Radius + 1),(Blast\Radius * 2) - 1,(Blast\Radius * 2) - 1,0 Oval Blast\X - (Blast\Radius - 1),Blast\Y - (Blast\Radius - 1),(Blast\Radius * 2) + 1,(Blast\Radius * 2) + 1,0 UpdateScoreHovers() DrawArena() WaitTimer GameFrameTimer Flip Wend Blasting = False End Function Function CreateScoreHover(ScoreHoverX,ScoreHoverY,ScoreHoverValue$) ScoreHover.ScoreHover = New ScoreHover ScoreHover\X = ScoreHoverX ScoreHover\Y = ScoreHoverY ScoreHover\Value = ScoreHoverValue ScoreHover\CreationTime = MilliSecs() End Function Function UpdateScoreHovers() SetFont HUDFont For ScoreHover.ScoreHover = Each ScoreHover VectorColor White Text ScoreHover\X,ScoreHover\Y,Scorehover\Value,True,True If MilliSecs() => ScoreHover\CreationTime + 1000 Delete ScoreHover EndIf Next End Function Function CreatePowerup(PowerupType) Powerup.Powerup = New Powerup Local Side = Rand(0,1) Powerup\Side = Side If Side = 0 Powerup\X = (GraphicsWidth() - 768) / 2 Else Powerup\X = GraphicsWidth() - ((GraphicsWidth() - 768) / 2) EndIf Powerup\Y = Rand(50,GraphicsHeight() - 51) Powerup\PowerupType = PowerupType End Function Function UpdatePowerups() For Powerup.Powerup = Each Powerup VectorColor Rand(White,Grey) Oval Powerup\X - 4,Powerup\Y - 4,9,9 If Powerup\Side = 0;left Powerup\X = Powerup\X + 1 Else Powerup\X = Powerup\X - 1 EndIf If Distance(Powerup\X,Powerup\Y,Player\X,Player\Y) <= 12 Select Powerup\PowerupType Case 1;rapid fire CreateScoreHover Powerup\X,Powerup\Y,"RAPID FIRE" RapidFire = RapidFire + 30 RapidFireTimer = MilliSecs() Case 2;super shot CreateScoreHover Powerup\X,Powerup\Y,"SUPER SHOT" SuperShot = SuperShot + 30 SuperShotTimer = MilliSecs() Case 3;invincibility CreateScoreHover Powerup\X,Powerup\Y,"INVINCIBLE" Invincible = Invincible + 10 InvincibleTimer = MilliSecs() Case 4;double score CreateScoreHover Powerup\X,Powerup\Y,"DOUBLE SCORE" DoubleScore = DoubleScore + 30 DoubleTimer = MilliSecs() End Select Delete Powerup Goto NextPowerup EndIf If Powerup\X < (GraphicsWidth() - 768) / 2 Or Powerup\X > GraphicsWidth() - ((GraphicsWidth() - 768) / 2) Delete Powerup EndIf .NextPowerup Next End Function Function Help() VectorColor Green SetFont MainFont Select HelpPage Case 1 Local PageTitle$ = "Vector GFX - Help" Text 512,150,"Welcome to Vector GFX, an entirely self-contained game,",True Text 512,200,"designed mainly to prove that games don't have to have",True Text 512,250,"advanced 3D rendering, motion blur, antialiasing, and so",True Text 512,300,"on, to be fun & cool-looking. In fact, Vector GFX uses",True Text 512,350,"no images, sounds, or music, ONLY TEN COLORS, yet it'll",True Text 512,400,"run on almost any old dinosaur PC!",True Text 512,500,"To play, you simply have to stay alive as long as you",True Text 512,550,"can by shooting your way through literally thousands of",True Text 512,600,"shapes. There's NO END to this - how long can YOU last?",True Case 2 PageTitle = "Player controls" Text 512,150,"The arrow keys are used to move around the arena. The",True Text 512,200,"A, W, D, and S keys are used to shoot left, up, right,",True Text 512,250,"and down, respectively. And don't forget - the spacebar",True Text 512,300,"fires a bomb. You'll need 'em - it's crazy in there.",True Text 512,400,"Good luck, Gamer!",True VectorColor White Oval 507,365,11,11,0 Line 512,370,512,363 Case 3 For I = 1 To 5 Shape.Shape = New Shape Shape\ShapeType = I Shape\XSpeed = 0 Shape\YSpeed = 0 Shape\XAcc = 0 Shape\YAcc = 0 Shape\X = 512 Select I Case 1 Shape\Y = 180 Case 2 Shape\Y = 280 Case 3 Shape\Y = 380 Case 4 Shape\Y = 480 Case 5 Shape\Y = 580 End Select Next PageTitle = "Shapes" Text 512,200,"These are your starter shapes - not much of a worry.",True Text 512,300,"Same as above, except they're worth more points. :)",True Text 512,400,"These ones are faster, and take two hits to take out.",True Text 512,500,"These guys are bad news - they're almost as fast as you.",True Text 512,600,"These ones have wide turns - they're easy to fool.",True Case 4 For I = 1 To 3 Shape.Shape = New Shape Shape\ShapeType = I + 5 Shape\XSpeed = 0 Shape\YSpeed = 0 Shape\XAcc = 0 Shape\YAcc = 0 Shape\X = 512 Select I Case 1 Shape\Y = 180 Shape\Radius = 7 Case 2 Shape\Y = 280 Case 3 Shape\Y = 380 End Select Next PageTitle = "Shapes (cont'd)" Text 512,200,"These ones split into mini-shapes when you shoot them.",True Text 512,300,"These shapes split too, and take THREE hits to destroy.",True Text 512,400,"These are the ultimate shapes - they're fast, and they",True Text 512,450,"split into a ring of mini-shapes THAT CAN'T BE SHOT.",True Case 5 VectorColor Red Oval 502,210,20,20,0 Oval 503,211,18,18,0 If MilliSecs() => HelpBlackHoleTimer + 5000 HelpBlackHoleTimer = MilliSecs() If HelpBlackHoleActive = True HelpBlackHoleActive = False Else HelpBlackHoleActive = True EndIf EndIf If HelpBlackHoleActive = True VectorColor White Oval 501,209,22,22,0 Oval 504,212,16,16,0 VectorColor Cyan Line 512,220,Rand(GraphicsWidth() - 1),0 Line 512,220,0,Rand(GraphicsHeight() - 1) Line 512,220,GraphicsWidth() - 1,Rand(GraphicsHeight() - 1) Line 512,220,Rand(GraphicsWidth() - 1),GraphicsHeight() - 1 EndIf VectorColor Green PageTitle = "Black Hole" Text 512,150,"The Black Hole. BIG trouble.",True Text 512,250,"The Black Hole appears about every 45 seconds, floating",True Text 512,300,"slowly after you. On its own it's not much, but as soon",True Text 512,350,"as you shoot it, things go crazy. A powerful gravity",True Text 512,400,"pulls you and everything else into it. It grows bigger",True Text 512,450,"with each shape it absorbs, until it finally explodes,",True Text 512,500,"releasing a halo of mini-shapes. The only way to stop it",True Text 512,550,"is to shoot it until it's finally destroyed. HOWEVER,",True Text 512,600,"each shape it absorbs increases its value, so you may",True Text 512,650,"want to let it grow a bit... If you can survive. ;)",True Case 6 PageTitle = "Powerups" VectorColor Rand(White,Grey) Oval 508,176,9,9 VectorColor Green Text 512,200,"There are four types of powerups: Rapid Fire, Super",True Text 512,250,"Shot, Invincibility, and Double Score. Rapid Fire",True Text 512,300,"doubles your shooting rate, and Super Shot fires bullets",True Text 512,350,"that go straight through all but the Black Hole. Double",True Text 512,400,"Score gives you twice as many points for shapes, and",True Text 512,450,"Invincibility protects you from everything.",True Text 512,500,"Each time you pick up a powerup, it lasts for thirty",True Text 512,550,"more seconds, except for Invincible, which lasts ten.",True Case 7 For I = 1 To 8 Shape.Shape = New Shape Shape\ShapeType = I Shape\XSpeed = 0 Shape\YSpeed = 0 Shape\XAcc = 0 Shape\YAcc = 0 Shape\X = -52 + (I * 125) Shape\Y = 180 If I = 6 Shape\Radius = 7 EndIf If I < 8 Text -53 + (I * 125),200,(I * 100),True Else Text -53 + (I * 125),200,"1000",True EndIf Next PageTitle = "Scoring" VectorColor Red Oval 502,280,20,20,0 Oval 503,281,18,18,0 VectorColor Green Text 512,300,"The black hole's value equals 100 times the number of",True Text 512,350,"shapes absorbed, plus 500. In a formula, this would be:",True Text 512,400,"(ShapesAbsorbed x 100) + 500",True Text 512,500,"Extra bombs are awarded every 50,000 points.",True Text 512,550,"Extra lives are awarded every 100,000 points.",True Case 8 PageTitle = "Credits" If MilliSecs() => PrevTitleBlast + 1000 + TitleBlastGap TitleBlastGap = Rand(-500,500) PrevTitleBlast = MilliSecs() CreateExplosion Rand(GraphicsWidth() - 1),Rand(GraphicsHeight() - 1),500 EndIf UpdateFrags(False) Text 512,150,"Vector GFX",True Text 512,250,"A Gigahertz Games freebie",True Text 512,350,"Programmed entirely in Blitz Basic by Adam Novagen",True Text 512,450,"Inspired by Geometry Wars, from the XBox Live Arcade",True VectorColor Red Text 512,550,"No bitmaps were harmed in the making of this game.",True End Select VectorColor White Text 512,700,"Page " + HelpPage + " of 8 - F2 to continue, F1 to return",True VectorColor Green SetFont TitleFont Text 512,10,PageTitle,True If KeyHit(F1Key) HelpPage = HelpPage - 1 If HelpPage > 5 HelpBlackHoleTimer = MilliSecs() HelpBlackHoleActive = False EndIf If HelpPage <= 0 GameStatus = 1 HelpPage = 1 EndIf ElseIf KeyHit(F2Key) HelpPage = HelpPage + 1 If HelpPage < 5 HelpBlackHoleTimer = MilliSecs() HelpBlackHoleActive = False EndIf If HelpPage => 9 GameStatus = 1 HelpPage = 1 For Frag.Frag = Each Frag Delete Frag Next EndIf EndIf End Function ;~IDEal Editor Parameters: ;~F#52#57#5C#62#68#6C#71#77#7C#126#17E#1A6#1C4#1FD#277#299#2AE#308#5A8#5D8 ;~F#66B#6ED#6F6#709#72B#778#7B3#7C0#7D2#7E4#80F ;~C#Blitz3D