From 2a0e7de95036f380a5729328c10ba86eb6e001ba Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 1 Nov 2005 00:58:44 +0000 Subject: Initial reasonably working version --- GFX/font.bmf | Bin 45472 -> 46816 bytes game.bmx | 2 +- hiscore.bmx | 92 ++++++++++++++++++++++++++++++++++++++------------------- types.bmx | 2 +- vectoroids.bmx | 2 ++ 5 files changed, 66 insertions(+), 32 deletions(-) diff --git a/GFX/font.bmf b/GFX/font.bmf index 267e412..4fd9de0 100644 Binary files a/GFX/font.bmf and b/GFX/font.bmf differ diff --git a/game.bmx b/game.bmx index 13afedf..29ebd9d 100644 --- a/game.bmx +++ b/game.bmx @@ -69,7 +69,7 @@ Type TGame saucertime=120*50 saucerdelay=0 - saucershot=25 + saucershot=150 NewLevel() End Method diff --git a/hiscore.bmx b/hiscore.bmx index 96c6935..5c4311b 100644 --- a/hiscore.bmx +++ b/hiscore.bmx @@ -37,7 +37,7 @@ Type THiscore For Local f:Int=0 Until NUM Local sc:Int=s.ReadInt() - Local n:String=s.ReadString(3) + Local n:String=s.ReadLine() o.score[f]=THiscoreEnt.Create(n,sc) Next @@ -48,8 +48,6 @@ Type THiscore End Function Method Save() - Return - Local s:TStream=WriteStream("vectoroids.hiscore") If s=Null @@ -60,7 +58,7 @@ Type THiscore For Local sc:THiscoreEnt=EachIn score s.WriteInt(sc.score) - s.WriteString(sc.name) + s.WriteLine(sc.name) Next s.Close() @@ -83,59 +81,93 @@ Type THiscore Next End Method - Method CheckScore(sc:Int) + Method Check(sc:Int) If scGameConfig.kleft Or del=0) - del=40 - last=GameConfig.kleft - cur:-1 - If cur<0 - cur:+Len(a) + If KeyDown(GameConfig.kleft) + If last<>GameConfig.kleft Or del=0 + If last=GameConfig.kleft + del=5 + Else + del=20 + EndIf + last=GameConfig.kleft + cur:-1 + If cur<0 + cur:+a.length + EndIf EndIf - EndIf - - If KeyHit(GameConfig.kright) And (last<>GameConfig.kright Or del=0) - del=40 - last=GameConfig.kright - cur:+1 - If cur=Len(a) - cur=0 + press=True + ElseIf KeyDown(GameConfig.kright) + If last<>GameConfig.kright Or del=0 + If last=GameConfig.kright + del=5 + Else + del=20 + EndIf + last=GameConfig.kright + cur:+1 + If cur=a.length + cur=0 + EndIf EndIf + press=True + Else + press=False + last=0 + del=0 EndIf - If KeyDown(GameConfig.khyper) And (last<>GameConfig.kright Or del=0) - del=40 - last=GameConfig.kright - cur:+1 - If cur=Len(a) - cur=0 + If KeyHit(GameConfig.khyper) + Local c:String=a[cur..cur+1] + + If c="{" + If nm.length>1 + nm=nm[0..nm.length-1] + ElseIf nm.length=1 + nm="" + EndIf + Else If c="}" + done=True + Else + nm:+c + If nm.length=3 + done=True + EndIf EndIf EndIf - GameGFX.font.Centre("enter your name for",0) - GameGFX.font.Centre("the hall of fame",20) - Flip FlushMem Wend + score[NUM-1]=THiscoreEnt.Create(nm.ToUpper(),sc) score.Sort() Save() End Method @@ -156,7 +188,7 @@ Type THiscoreEnt Local os:THiscoreEnt=THiscoreEnt(o) If os - Return score-os.score + Return os.score-score Else Return 0 EndIf diff --git a/types.bmx b/types.bmx index 588a152..2f2175a 100644 --- a/types.bmx +++ b/types.bmx @@ -254,7 +254,7 @@ Type TShot x:-GraphicsHeight() EndIf - If saucer And saucer.obj.IsInside(x,y) + If saucer And Not saucer.dead And saucer.obj.IsInside(x,y) TParticleMachine.ShipExplosion(saucer.x,saucer.y) Sounds.ShipExplosion() Sounds.NoSaucer() diff --git a/vectoroids.bmx b/vectoroids.bmx index 8f51c55..69563f9 100644 --- a/vectoroids.bmx +++ b/vectoroids.bmx @@ -54,6 +54,8 @@ While Not quit While game.Play() Wend Sounds.Clear() + TParticleMachine.Clear() + hiscore.Check(game.score) Menu() Wend -- cgit v1.2.3