Hello,

I've changed the movement from 3 to 4 now, so that it can be divided correctly... since my level is made of 64x64 tiles ...

I think the problem is here but don't know how to fix....

Left and Top works always on my level everywhere... it stops right there when it reaches the wall (no pixel left out...) , and I can continue to move in any other direction ...

Left = works
Top = works
Right = stops 4 pixels sooner then it should...always
Bottom = stops 4 pixels sooner then it should...always

meanwhile I've also found out that it's important where my character starts... so I've set the starting position to

X (3x64)-32
Y (3x64)-32

I hope I'm not wrong here, but currently my tiles are 64x64, whereas my character is 32x32.

I've checked the Right and Bottom testwall functions... it works as it should because it is right that if it lets another +4 to x or +4 to y ... it is true... only thing is I can't seem to firugre it out... how the heck does it work correctly for Left and Top...
Code:
 
 
           if GetKeyState(VK_LEFT) < 0 then
            begin
              if not Blurp.testForWall(Blurp.X-4,Blurp.Y,Blurp.Image.Width,Blurp.Image.Height) then
                begin
                  Blurp.X:=Blurp.X-4;
                  AdSpriteEngine.X:=AdSpriteEngine.X+4;
                end;
            end;
          if GetKeyState(VK_RIGHT) < 0 then
            begin
              if not Blurp.testForWall(Blurp.X+4,Blurp.Y,Blurp.Image.Width,Blurp.Image.Height) then
                begin
                  Blurp.X:=Blurp.X+4;
                  AdSpriteEngine.X:=AdSpriteEngine.X-4;
                end;
            end;
          if GetKeyState(VK_UP) < 0 then
            begin
              if not Blurp.testForWall(Blurp.X,Blurp.Y-4,Blurp.Image.Width,Blurp.Image.Height) then
                begin
                  Blurp.Y:=Blurp.Y-4;
                  AdSpriteEngine.Y:=AdSpriteEngine.Y+4;
                end;
            end;
          if GetKeyState(VK_DOWN) < 0 then
            begin
              if not Blurp.testForWall(Blurp.X,Blurp.Y+4,Blurp.Image.Width,Blurp.Image.Height) then
                begin
                  Blurp.Y:=Blurp.Y+4;
                  AdSpriteEngine.Y:=AdSpriteEngine.Y-4;
                end;
Code:
function TBlurp.testForWall(spriteXpos,spriteYpos:single;spriteWidth,spriteHeight:integer):boolean;
begin
  testForWall := false;
  if not (TileInfo[round(spriteXpos) div 64, round(spriteYpos) div 64].tilenr in [2]) or not
  (TileInfo[(round(spriteXpos)+spriteWidth) div 64, round(spriteYpos) div 64].tilenr in [2]) or not
  (TileInfo[round(spriteXpos)div 64, (round(spriteYpos)+spriteHeight) div 64].tilenr in [2]) or not
  (TileInfo[(round(spriteXpos)+spriteWidth) div 64, (round(spriteYpos)+spriteHeight) div 64].tilenr in [2]) then testForWall :=true;
end;
Greetings
Rob