2d array as a type object

BlitzMax Forums/BlitzMax Beginners Area/2d array as a type object

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.

what am i doing wrong here now???



Graphics 1024,768,0,75',32

Type Tmap

Local levelmap:Int [][]

levelmap=levelmap[100]

For i=0 To 100
levelmap=levelmap[i][100]
Next


Method init()
	For x=0 To 100
		For y=0 To 100
			levelmap [x][y]=Rand(0,1)
		Next
	Next		
End Method

Method drawmap()
	For x=0 To 100
		For y=0 To 100
			If levelmap [x][y]=1
				SetColor 255,0,0	
			Else
				SetColor 0,255,0
			EndIf
			DrawRect x*16,y*16,16,16,1
		Next
	Next	
End Method

End Type



tmap.init()

Repeat 

Cls
	tmap.drawmap()
Flip

Until Keydown(key_escape)