Hmm. I'm using the demo, and I am trying to include an object inside an object. When I try to compile this though, it gives me a memory exception error...
help, please??
SuperStrict
'armor protects
Type Armor
Field iLight:Int
Field iHeavy:Int
Method New()
iLight = 0
iHeavy = 0;
End Method
End Type
Type Unit
Field armor:Armor = New Armor ' <- errorrrr
Method New()
armor.iLight = 0
armor.iHeavy = 0
End Method
End Type
Type Unit_Infantry Extends Unit
Method New()
armor.iLight = 4
armor.iHeavy = 2
End Method
End Type
Global UNITS_INFANTRY:Unit_Infantry = New Unit_Infantry
Print UNITS_INFANTRY.armor.iLight
|