Author Topic: Colliding Tilemap and FlxObject, problem with separation  (Read 773 times)


  • Active Member
  • ***
  • Posts: 213
  • Karma: +0/-0
    • View Profile
    • GemaNeko
Hi there...

Basically in my game player can travel through overworld and underworld.  When player dies for example he is transported to underworld. How this is achieved is that I increase player's y position until he reaches underworld, and then I check is there a tile touching 1 of his corners ( topleft, bottomright etc. )  . All this works perfectly.

Problem is that when player touches tilemap a little ( even by 0.25 ) separation code ( Flixel's internal code ) doesn't separate it in way that player is moved to closes possible empty space, but instead he is moved inside of the tile....:s

While player is moving through tilemap, colliding is switched off. Then after he comes at correct position, I switch collision on.

Can anyone give me suggestion what to do ?   Thanks.

I also tried 1 more thing.  After I find the correct position, I move player in opposite direction, and I test does player collides the map. If he does, I stop.  Problem is that flxg.collide and Flxg.overlap doesn't return me correct values, they return all the time that player is not overlaping / colliding tilemap, which is really weird...:P
« Last Edit: Tue, Aug 2, 2011 by xraven13 »