but my code works by moving a character towards the point where the mouse was clicked so i can use if keydown etc
Yes, I know. I wasn't replacing your code but showing that your ideas does work. plus cls would get rid of the background?
It would. If you're redrawing every tile each time anyway then you don't need the cls. Again, I wasn't giving you an answer.What is it you're looking for? Pointers in the right direction, a fix for this particular problem or some code?
Anyway, move your assignment of old_x and old_y up your code...
If old_x = block_xpos And old_y = block_ypos DrawImage(indy_r,block_xpos,block_ypos) Else If old_x > block_xpos DrawImage(indy_wl,block_xpos,block_ypos,frame) If MilliSecs() >tmr + anim_speed tmr = MilliSecs() frame = frame +1 If frame = 6 Then frame =0 EndIf EndIf EndIf EndIf ResetCollisions() old_y = block_ypos old_x = block_xpos 'move up If block_ypos > ytarget If ImagesCollide(block,block_xpos,block_ypos-1,0,walkable_area,40,40,0)= 0 block_ypos:- 1 EndIf EndIf ResetCollisions() 'move down If block_ypos < ytarget If ImagesCollide(block,block_xpos,block_ypos+1,0,walkable_area,40,40,0)= 0 block_ypos:+ 1 EndIf EndIf ResetCollisions() 'move left If block_xpos > xtarget If ImagesCollide(block,block_xpos-1,block_ypos,0,walkable_area,40,40,0)= 0 block_xpos:- 1 EndIf EndIf ResetCollisions() 'move right If block_xpos < xtarget If ImagesCollide(block,block_xpos+1,block_ypos,0,walkable_area,40,40,0)= 0 block_xpos:+ 1 EndIf EndIf ResetCollisions()