Ok here is my source code so far after 20 mins.
What I want is for you guys to look at the control function. What I'm trying to do is draw an outline(icon image) over the currently selected area of the array or map.
media here : http://www.kamikazekrow.com/storage/tiles.zip
Basically I am trying to draw an outline around the current tile.
Graphics 640,480,0 Global tileset = LoadAnimImage("tileset.png",16,16,0,9) SetMaskColor 0,0,0 Global icon = LoadImage("icon.png") MidHandleImage icon Global MX:Int,MY:Int Global mapX:Int,mapY:Int Global gx:Int,gy:Int Global tx:Int,ty:Int tx = 50 Global map[40,20] Repeat Cls draw_tileset() update_map() control() Flip Until KeyHit(KEY_ESCAPE) = True Function update_map() For x:Int = 0 To 39 For y:Int = 0 To 19 If map[x,y] > 0 And map[x,y] < 9 gx = x*16 gy = y*16 DrawImage tileset,gx,gy,map[x,y] EndIf Next Next End Function Function control() MX = MouseX() MY = MouseY() For x = 0 To 39 For y = 0 To 19 If MX = map[x,y] And MY = map[x,y] DrawImage icon,MX,MY,0 EndIf Next Next End Function Function draw_tileset() tx = 100 For i:Int = 0 To 8 DrawImage tileset,tx,464,i tx = tx + 16 Next End Function
What I want is for you guys to look at the control function. What I'm trying to do is draw an outline(icon image) over the currently selected area of the array or map.
media here : http://www.kamikazekrow.com/storage/tiles.zip
Basically I am trying to draw an outline around the current tile.