Fehler: "Macro-Fehler: Can't specify empty parameter for a macro".
In PB4.0 gibs den Fehler nicht. Dürfte ein PB-Bug sein, fals ja wäre es
schön, wenn den Fehler jemand im englischen Forum posten könnte. Fals
nicht, wüsst ich natürlich gern was ich falsch mache
Code: Alles auswählen
Structure Map
Number.l
StartX.l
StartY.l
StartMap.l
Time.l
Key.l
Hebel.l
Armbrust.l
Loch.l
Grube.l
Sack.l
Bombe.l
LoadNum.l
EndStructure
Global Map.Map
Structure PlayerData
X.l
Y.l
Map.l
StepX.f
StepY.f
State.l
Energy.l
Time.l
Sack.l
KeyHave.l
KeyUsed.l
Steps.l
Difficult.l
EndStructure
Global PlayerData.PlayerData
Structure GUI
SpSack.l
SpSackAll.l
SpTime.l
SpKeyHave.l
SpKeyUsed.l
SpKeyAll.l
SpEnergy.l
SpSteps.l
EndStructure
Global GUI.GUI
Global Dim ColorTable.l(255)
Procedure CreateFont(Text$, Color.l, HColor.l, Typ.l=1)
EndProcedure
Macro PlayerStep()
PlayerData\X + StepX
PlayerData\Y + StepY
If Load = #False
PlayerData\StepX = -StepX
PlayerData\StepY = -StepY
EndIf
EndMacro
Macro CounterFont(Sprite, Value, Color=16)
If Sprite : FreeSprite(Sprite) : EndIf
Sprite = CreateFont(Value, Color, 4)
TransparentSpriteColor(Sprite, ColorTable(4))
EndMacro
Macro SackCounter(Add)
PlayerData\Sack#Add
CounterFont(GUI\SpSack, RSet(Str(PlayerData\Sack), Len(Str(Map\Sack))))
EndMacro
Macro SackAllCounter(Add)
Map\Sack#Add
CounterFont(GUI\SpSackAll, "/"+Str(Map\Sack))
EndMacro
Macro StepCounter(Add)
PlayerData\Steps#Add
CounterFont(GUI\SpSteps, Str(PlayerData\Steps))
EndMacro
Macro KeyUsedCounter(Add)
PlayerData\KeyUsed#Add
CounterFont(GUI\SpKeyUsed, "/"+RSet(Str(PlayerData\KeyUsed), Len(Str(Map\Key)))
EndMacro
Macro KeyHaveCounter(Add)
PlayerData\KeyHave#Add
CounterFont(GUI\SpKeyHave, RSet(Str(PlayerData\KeyHave), Len(Str(Map\Key))))
EndMacro
Macro KeyAllCounter(Add)
Map\Key#Add
CounterFont(GUI\SpKeyAll, "/" + Str(Map\Key))
EndMacro
Macro TimeCounter(Add)
PlayerData\Time#Add
If PlayerData\Time <= 30 : Color = 33 : ElseIf PlayerData\Time <= 60 : Color = 55 : Else : Color = 16 : EndIf
If PlayerData\Time < 0 : PlayerData\Time = 0 : EndIf
CounterFont(GUI\SpTime, Str(Int(PlayerData\Time / 60)) + ":" + RSet(Str(PlayerData\Time % 60), 2, "0"), Color)
EndMacro
SackCounter(=0)
SackAllCounter(+0)
TimeCounter(=PlayerData\Time)
KeyHaveCounter(=0)
KeyUsedCounter(=0)
KeyAllCounter(+0)
StepCounter(=0)