Updateing Framecount individually?

BlitzMax Forums/BlitzMax Beginners Area/Updateing Framecount individually?

I commented out all of the "redundant" stuff. you don't need to create a list if you are storing the values in the arrays.
SuperStrict


Graphics 800, 600

Global bomb:TImage = LoadAnimImage("bomb.png", 32, 32, 0, 14) 


Global MapWidth:Int = 25
Global MapHeight:Int = 600 / 32

Global MapArray:TTile[MapWidth, MapHeight]

Type TTile
	Field x:Int
	Field y:Int
	Field image:TImage
	Field Frame:Int
	Field BombFRame:Int
	Field BombFrameTimer:Int
	
	Global List:TList
	
	Function Create:TTile() 
		Return New TTile
	End Function
	
	Function PrefillMapArray() 
		For Local y:Int = 0 Until MapHeight
			For Local x:Int = 0 Until MapWidth
				MapArray[x, y]= TTile.Create() 
				MapArray[x, y].Frame = 0
				MapArray[x, y].BombFrameTimer = MilliSecs() ' I moved this here from CreateBomb Function.
				'If MapArray[x, y].Frame = 0
				'	TTile.CreateBomb
				'End If
			Next
		Next
	End Function
	
	Function Draw() 
		For Local x:Int = 0 Until MapWidth
			For Local y:Int = 0 Until MapHeight
				Select MapArray[x, y].Frame
					Case 0
						DrawImage bomb, X * 32, Y * 32, 0
					Case 1
						' This bit below. I want the bombs to animate seperetaly when the character is on it.
						' Useing the mouse position to activate the anim would be fine for this example.
						'For Local b:TTile = EachIn TTile.List
							DrawImage bomb, x * 32, y * 32, MapArray[x,y].BombFRame
							MapArray[x,y].UpdateBomb
						'Next
				End Select
			Next
		Next
	End Function

	'Function CreateBomb() 
	'	If Not TTile.List
	'		TTile.List = CreateList() 
	'	End If
	'	Local b:TTile = New TTile
	'	b.BombFRame = 0
	'	b.BombFrameTimer = MilliSecs() 
	'	TTile.List.AddLast(b) 
	'End Function
	
	Method UpdateBomb() 
		If MilliSecs() > BombFRameTimer + 200
			BombFrame:+1
			If BombFrame > 13 Then BombFrame = 0
			BombFrameTimer = MilliSecs() 
		End If
	End Method
	
	Function ActivateBomb() 
		If MapArray[MouseX() / 32, MouseY() / 32].Frame = 0
			If MouseHit(MOUSE_LEFT) 
				MapArray[MouseX() / 32, MouseY() / 32].Frame = 1
			End If
		End If
	End Function
End Type


TTile.PrefillMapArray

While Not KeyHit(KEY_ESCAPE) 
	Cls
		TTile.Draw
		TTile.ActivateBomb
	Flip
	
Wend