I'm having some trouble with collisions between masked images. With the code listed here the tank can overlap the tiles quite a bit without regestering a hit. I've tried without the rotation and still the results are bad. The only thing that seems to fix it is to load the images without masking them. Any ideas on what could be wrong?
Here are the images I'm using:

Strict Graphics 640,480,0 Type tTank Field x,y,rot:Float Field img:tImage Function Create:tTank(file:String) Local this:tTank=New tTank this.x=200 this.y=200 this.rot=0 SetMaskColor 255,0,255 this.img=LoadImage(file,MASKEDIMAGE) SetImageHandle(this.img,ImageWidth(this.img)/2,ImageHeight(this.img)/2) Return this End Function Method Update() x=MouseX() y=MouseY() rot:+1 SetRotation rot DrawImage img,x,y End Method End Type Type tTile Field x Field y Field frame End Type SetMaskColor 255,0,255 Local tiles:tImage=LoadAnimImage("Terrain2.bmp",32,32,0,6,MASKEDIMAGE) Local tnk:tTank=tTank.create("tank.bmp") Local colTiles:tList=CreateList() For Local n=0 Until 30 Local t:tTile=New tTile t.x=rnd(GraphicsWidth()-ImageWidth(tiles)) t.y=rnd(GraphicsHeight()-ImageHeight(tiles)) t.frame=rnd(5) colTiles.AddLast t Next Repeat Cls SetRotation 0 For Local t:tTile=EachIn colTiles DrawImage tiles,t.x,t.y,t.frame Next tnk.update If CheckCollision(tnk,tiles,colTiles,tnk.x,tnk.y) SetRotation 0 DrawText "COLLISION!!",0,0 EndIf FlushMem Flip Until KeyHit(KEY_ESCAPE) Function CheckCollision(tnk:tTank,tiles:tImage,colTiles:tList,x,y) ResetCollisions 1 SetRotation 0 For Local t:tTile=EachIn colTiles CollideImage(tiles,t.x,t.y,t.frame,0,1) Next SetRotation tnk.rot If CollideImage(tnk.img,x,y,0,1,0) Then Return 1 Return 0 End Function
Here are the images I'm using:
