Quote Originally Posted by robert83 View Post
I DID IT !!!!

Without your help i wouldn't get this far this soon... but it still feels kinda good

Code:
   Result.Left      := Math.Floor((x +(Image.Width/2) + vx) / cTileW);
  Result.Right     := Math.Floor((x + (Image.Width/2) + vx) / cTileW);
  Result.Up        := Math.Floor((y + (Image.Height/2) + vy) / cTileH);
  Result.Down      := Math.Floor((y + (Image.Height/2) + vy) / cTileH);
for some reason, and I will need to figure it out why... Left and UP works if instead of - I do + Image.Widht/2 and + Image.Height/2
That's great news

I realised I forgot to mention these facts which are kind of crucial

With the code I gave you, the world coordinate system I was working has the origin at the top left of the screen, so:

left = -movement
right = +movement
up = -movement
down = +movement

so you need to match the +/- with your Adorra 2d screen coordinate system.

Since you said left and up now seem to work using + instead of - as in my example then I would guess you need to use this now:

Code:
   Result.Left      := Math.Floor((x +(Image.Width/2) + vx) / cTileW);
  Result.Right     := Math.Floor((x - (Image.Width/2) + vx) / cTileW);
  Result.Up        := Math.Floor((y + (Image.Height/2) + vy) / cTileH);
  Result.Down      := Math.Floor((y - (Image.Height/2) + vy) / cTileH);
does this change things?

cheers,
Paul