Results 1 to 10 of 31

Thread: Collission detection on level ( source Travels doc + some other examples)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #24
    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

    Now I can go to the wall everywhere...there is one small bug... with any direction if I have a single WALL in center or anywhere...where I can move around it...
    my character can anter this WALL from LEFT or RIGHT if my character is HIGHER or LOWER then this WALL by more then my Characters own Height/2.

    C is character points , X is wall... can move inside wall... but only if I touch it like that... UP DOWN, LEFT and RIGHT works...
    Code:
       CC
       CCXX
        XXX
       CCXX
       CC



    Same thing happens for UP and DOWN... my Character can enter the WALL from UP and DOWN if it's LEFT or RIGHT side is free by more then its Width/2.
    (hopefully I've managed to write this down and someone understand's this... my english might be bad)

    Regarding the vx and vy ... I've studied a few demos..samples... I know it works...now, but was wondering if I'm doing this the right way, the way it was meant to be done in Andorra 2d (or if this is not specific to just this engine... then any other engine).

    Damn... was to soon to say... It seems if I change...vx or vy to other value... it does not work correctly...guess this only works cause I made a "lucky" bug

    Greetings
    Robert
    Last edited by robert83; 18-08-2011 at 03:33 PM. Reason: is vx and vy set correctly?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •