ok the idea is that i click with the mouse and this code moves a image called block towards the target one pixel at a time cheaking one pixel ahead before moving.
before i move the character (indy) i store his postion as old_x and old_y, and the next time round the loop if the old xy is the same as the new xy i would like it to draw the idle indy image.
this code doesnt work ? it displays the idle pos but when i move left it just keeps playing the walk left anim even when he stops. also i can think of a way to have the idle image face the way indy was traveling last.
before i move the character (indy) i store his postion as old_x and old_y, and the next time round the loop if the old xy is the same as the new xy i would like it to draw the idle indy image.
this code doesnt work ? it displays the idle pos but when i move left it just keeps playing the walk left anim even when he stops. also i can think of a way to have the idle image face the way indy was traveling last.
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() 'move up If block_ypos > ytarget If ImagesCollide(block,block_xpos,block_ypos-1,0,walkable_area,40,40,0)= 0 old_y = block_ypos 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 old_y = block_ypos 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 old_x = block_xpos 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 old_x = block_xpos block_xpos:+ 1 EndIf EndIf ResetCollisions()