Types n stuff

BlitzMax Forums/BlitzMax Programming/Types n stuff

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I have a type "Tiles" and two sub types that extend it called "background" and "foreground"
Type Tiles
	Field X,Y
	Method Draw()
	
	End Method
End Type
Global Tile_List:TList = CreateList()

the sub types have their own draw methods
' Back
Type B_Type Extends Tiles
	Field F
	
	Method Draw()
		If x > Screen_X - Screen_Border And x < Screen_X_Max + Screen_Border
			If y > Screen_Y - Screen_Border And y < Screen_Y_Max + Screen_Border	
				DrawImage gfxTileset,x,y,f
			EndIf
		EndIf
	End Method
	
End Type

and when I create one of either sub types they get added to the main list
Tile_List.AddLast( NewB )

I want to be able to easily draw all of the tiles with one command... so I was thinking
	For Local Tile:Tiles = EachIn Tile_List
		Tile.Draw()
	Next

However, this just runs the Draw method from the Tiles type. If I remove said method, the command "Tile.Draw()" doesnt work. But I want each entry in the list to run its own Draw method.

What am i doing wrong? ta!