A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Collision problem, please help !

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    23

    Unhappy Collision problem, please help !

    I'm currently making a platformer with someone else and we want the character to be able to slide along walls, much like megamanX.

    I have achieved it, and added camera effect to move along the stage and now, instead of sliding, my character sticks to the wall.

    My BIG problem is... when I debug the game, everything runs perfectly fine ! How can that be ?

    I'm using hitTest with shapeflag to detect collision, does the problem come because flash doesn't update the shape perfectly on every frame ? Is there a way to force refresh maybe ?

    Check this out if you don't really understand, try jumping at the walls.
    working :
    http://www.prevost-jm.com/jack2.swf
    not working :
    http://www.prevost-jm.com/jack1.swf
    (Try jumping on the right wall, while the camera moves, the go to the left to trigger the camera again while you jump to the wall)

  2. #2
    Junior Member
    Join Date
    Mar 2008
    Posts
    23
    Ok...

    Corrected the problem by moving all code collision related at the very start of the frame, which means the frame gets refreshed before the tests, but also before correcting position, and player can stay for 1 frame sticking in the walls....

    Any idea ?

Tags for this Thread

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center