summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GFX/font.bmfbin45472 -> 46816 bytes
-rw-r--r--game.bmx2
-rw-r--r--hiscore.bmx92
-rw-r--r--types.bmx2
-rw-r--r--vectoroids.bmx2
5 files changed, 66 insertions, 32 deletions
diff --git a/GFX/font.bmf b/GFX/font.bmf
index 267e412..4fd9de0 100644
--- a/GFX/font.bmf
+++ b/GFX/font.bmf
Binary files 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 sc<score[NUM-1].score
Return
EndIf
Local done:Int=False
Local a:String="abcdefghijklmnopqrstuvwxyz{}"
- Local curs:Int=0
+ Local cur:Int=0
Local nm:String=""
Local last:Int=0
Local del:Int=0
+ Local tx:Int=GraphicsWidth()/2-GameGFX.font.TextWidth("___")
+ Local press:Int=False
While Not done
Cls
+ GameGFX.font.Centre("enter your name for",0)
+ GameGFX.font.Centre("the hall of fame",20)
+
+ SetScale(2,2)
+ GameGFX.font.Draw("___",tx,300)
+ GameGFX.font.Draw(nm+a[cur..cur+1],tx,300)
+ SetScale(1,1)
+
If del
del:-1
EndIf
- If KeyHit(GameConfig.kleft) And (last<>GameConfig.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