Re: Hilfe bei Strukturen (Elemente zufügen/löschen/finden)
Verfasst: 08.02.2018 22:25
Meinst du so was in der Art?
Code: Alles auswählen
Structure ACTOR
x.i
y.i
EndStructure
Structure MONSTER Extends ACTOR
name$
hp.i
EndStructure
Structure OBJECT Extends ACTOR
type$
locked.i
EndStructure
Global NewList *act.ACTOR()
Global NewList mon.MONSTER()
Global NewList obj.OBJECT()
AddElement(*act())
*act() = AddElement(mon())
mon()\x = 10
mon()\y = 5
mon()\name$ = "Goblin"
mon()\hp = 20
AddElement(*act())
*act() = AddElement(obj())
obj()\x = 11
obj()\y = 6
obj()\type$ = "Schatztruhe"
obj()\locked = 0
ForEach mon()
Debug mon()\name$+" ("+mon()\hp+") "+mon()\x+","+mon()\y
Next
Debug ""
ForEach obj()
Debug obj()\type$+" ("+obj()\locked+") "+obj()\x+","+obj()\y
Next
Debug ""
ForEach *act()
Debug "" + *act()\x + "," + *act()\y
Next