I've read this tutorial:
http://www.alsbonsai.com/john/BlitzMax_OOP_Tutorial.pdf
this is one of the examples:
But I don't understand how I can access the field "enterable" in the buildingtype, while going through the list.
A bit of help please?
http://www.alsbonsai.com/john/BlitzMax_OOP_Tutorial.pdf
this is one of the examples:
Type TEntity Field x:Float, y:Float Method Draw() Abstract End Type Type TPlayer Extends TEntity Field Health:Int Method Draw() SetColor 0, 0, 255 DrawOval x, y, 5, 5 End Method End Type Type TRobot Extends TEntity Field Health:Int Method Draw() SetColor 255, 0, 0 DrawOval x, y, 5, 5 End Method End Type Type TBuilding Extends TEntity Field Enterable:Int Method Draw() SetColor 255, 255, 255 DrawRect x - 5, y - 5, 10, 10 End Method End Type Graphics 640, 480 Local EntityList:TList = New TList Local obj:TPlayer = New TPlayer obj.x = 5 obj.y = 7 EntityList.AddLast(obj) Local obj2:TBuilding = New TBuilding obj2.x = 15 obj2.y = 3 EntityList.AddLast(obj2) 'Draw all entities Local ent:TEntity For ent = EachIn EntityList ent.Draw() Next Flip WaitKey
But I don't understand how I can access the field "enterable" in the buildingtype, while going through the list.
A bit of help please?