From cf0e1b5f3422dc1adc60b1684591ab0962c441bb Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 5 Dec 2005 00:59:34 +0000 Subject: Updates and added help page --- game.bmx | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'game.bmx') diff --git a/game.bmx b/game.bmx index 16fb3e7..64bf2d5 100644 --- a/game.bmx +++ b/game.bmx @@ -22,6 +22,8 @@ Type TGame Field block:TPiece Field nextblock:TPiece Field drop:Int + Field fade:TFadeScreen + Field bdrop:TGameBackdrop Method New() score=0 @@ -29,6 +31,7 @@ Type TGame level=1 Particles.Clear() TextParticles.Clear() + ExplosionParticles.Clear() alpha=0.0 alphainc=0.01 count=0 @@ -36,6 +39,8 @@ Type TGame nextblock=TPiece.Create(False) drop=False CreateNext(False) + fade=TFadeScreen.FadeIn() + bdrop=New TGameBackdrop End Method Method SetInitLevel(l:Int) @@ -86,12 +91,16 @@ Type TGame For Local f:Int=0 Until a.length SetAlpha(al) SetRotation(a[f]) - SetScale(al,al) + SetScale(al*2,al*2) DrawImage(i,GraphicsWidth()/2,GraphicsHeight()/2) If ac[f]>0 ac[f]:-1 Else - a[f]:+1 + If f Mod 2 + a[f]:+1 + Else + a[f]:-1 + EndIf EndIf al:+0.1 Next @@ -115,12 +124,20 @@ Type TGame Cls + bdrop.Draw() + GameGFX.large.Draw("SCORE",0,0,255,255,0) GameGFX.large.Draw(score,0,20) GameGFX.large.Draw("LEVEL",0,100,255,255,0) GameGFX.large.Draw(level,0,120) + GameGFX.large.Draw("HISCORE",0,200,255,255,0) + If score>GameConfig.hiscore + GameConfig.hiscore=score + EndIf + GameGFX.large.Draw(GameConfig.hiscore,0,220) + nextblock.Draw() block.Draw() @@ -148,7 +165,7 @@ Type TGame If Not gm.overflow score:+level*2 - CreateNext((total Mod 2)=0) ' 15 + CreateNext((total Mod 15)=0) ' 15 Else FlushKeys() EndIf @@ -217,6 +234,7 @@ Type TGame EndIf Particles.Draw() + ExplosionParticles.Draw() TextParticles.Draw() If KeyHit(GameConfig.kpause) And Not gm.overflow @@ -224,6 +242,15 @@ Type TGame EndIf Sound.Process() + + If fade + If fade.Fade() + fade.Draw() + Else + fade=Null + EndIf + EndIf + Flip Return playing -- cgit v1.2.3