summaryrefslogtreecommitdiff
path: root/level.bmx
diff options
context:
space:
mode:
Diffstat (limited to 'level.bmx')
-rw-r--r--level.bmx57
1 files changed, 42 insertions, 15 deletions
diff --git a/level.bmx b/level.bmx
index 254ac5d..4b1c020 100644
--- a/level.bmx
+++ b/level.bmx
@@ -10,10 +10,11 @@ Import noddybox.bitmapfont
Import noddybox.algorithm
Import "types.bmx"
-Const MAGIC:String="PPINCH_0001"
+Const MAGIC:String="PPINCH_0002"
Const MAX_GRAV:Int=10
Const MAX_POINT:Int=1000
+Const MAX_WAVE:Int=10
Type TLevelException
Field message:String
@@ -151,34 +152,52 @@ End Type
Type TLevel
Field name:String
- Field maxmass:Int
+ Field maxwave:Int
Field grav:TList
Field point:TList
Field winpercent:Int
Field timer:Int
Field invmass:Int
- Field placemass:Double
- Field placefriend:Int
+ Field shipmass:Double
+ Field wavemass:Double
+ Field wrap:Int
+ Field startx:Double
+ Field starty:Double
+ Field startang:Int
Method New()
grav=CreateList()
point=CreateList()
name="Unititled"
- maxmass=5
+ maxwave=5
winpercent=50
- timer=60
+ timer=120
invmass=False
- placemass=25
- placefriend=True
+ shipmass=5
+ wavemass=5
+ wrap=False
+ startx=399
+ starty=400
+ startang=0
End Method
- Method CreatePlayfield(masslist:TList, pointlist:TList)
+ Method CreatePlayfield:TShip(masslist:TList, pointlist:TList)
For Local gp:TGravPoint=EachIn grav
masslist.AddLast(gp.CreateMass())
Next
For Local lp:TPointLine=EachIn point
lp.CreatePoints(pointlist)
Next
+
+ Local s:TShip=New TShip
+
+ s.x=startx
+ s.y=starty
+ s.a=startang
+ s.mass=shipmass
+ s.img=GameGFX.ship
+
+ Return s
End Method
Function FromStream:TLevel(s:TStream)
@@ -186,12 +205,16 @@ Type TLevel
Local c:Int
o.name=s.ReadLine()
- o.maxmass=s.ReadInt()
+ o.maxwave=s.ReadInt()
o.winpercent=s.ReadInt()
o.timer=s.ReadInt()
o.invmass=s.ReadInt()
- o.placemass=s.ReadDouble()
- o.placefriend=s.ReadInt()
+ o.shipmass=s.ReadDouble()
+ o.wavemass=s.ReadDouble()
+ o.wrap=s.ReadInt()
+ o.startx=s.ReadDouble()
+ o.starty=s.ReadDouble()
+ o.startang=s.ReadInt()
c=s.ReadInt()
For Local f:Int=1 To c
@@ -208,12 +231,16 @@ Type TLevel
Method ToStream(s:TStream)
s.WriteLine(name)
- s.WriteInt(maxmass)
+ s.WriteInt(maxwave)
s.WriteInt(winpercent)
s.WriteInt(timer)
s.WriteInt(invmass)
- s.WriteDouble(placemass)
- s.WriteInt(placefriend)
+ s.WriteDouble(shipmass)
+ s.WriteDouble(wavemass)
+ s.WriteInt(wrap)
+ s.WriteDouble(startx)
+ s.WriteDouble(starty)
+ s.WriteInt(startang)
s.WriteInt(grav.Count())
For Local o:TGravPoint=EachIn grav