So I've been offline for a while and decided to throw away the tile by tile moving idea, atleast for now. Right now I want my 'hero' to walk only on tiles of grass and path, so I used this for staying off water:
[pascal]If (isRight in form20.DXInput1.keyboard.States) Then
begin
oldx:=hero.X;
oldy:=hero.Y;
hero.x:=hero.x + 4;
tempy:=round(hero.Y/tilesize - 0.4444);
hero.y:=tempy*tilesize;
if tileinfo[rx, ry].tilenr = 2 then
begin
hero.X:=oldx;
hero.Y:=oldy;
end;
end;
[/pascal]
Well, it does its thing with a minor glitch - after walking on water tile, my 'hero' stops responding to controls. Any other thoughts on how to solve this minor problem, because I hate it whan my 'hero' steps on water like Jesus Christ...
BTW: I know this code of mine is totaly lame, but what can I do ops: