SuperStrict Graphics 1024,768,0,75',32 Type Tmap Field levelmap:Int[,] Field Width:Int, Height:Int Function Create:TMap(w:Int, h:Int) Local This:TMap = New TMap This.levelmap = New Int[100,100] This.Width = w This.Height = h Local x:Int, y:Int For x=0 Until w For y=0 Until h This.levelmap[x,y]=Rand(0,1) Next Next Return This EndFunction Method drawmap() Local x:Int, y:Int For x=0 Until width For y=0 Until height If levelmap[x,y]=1 SetColor 255,0,0 Else SetColor 0,255,0 EndIf DrawRect x*16,y*16,16,16 Next Next End Method End Type Local Map:TMap = TMap.Create(100,100) Repeat Cls Map.drawmap() Flip Until KeyDown(key_escape)
Sorry, dont have time to explain the changes right now, but it'll give you something to study. (maybe somebody else can give you some pointers on what you did wrong in your original code)