Author Topic: Flixel 2.55 Left collision goes into wall? [SOLVED]  (Read 1747 times)

azumaril

  • Member
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
I cannot understand why this is happening, but I set a character to collide with walls and he correctly collides when touching on the right side, but when touching a wall on his left he goes into the wall slightly. If you stop moving, he is ejected backwards one pixel so he is no longer slightly overlapping the wall.

I've found that it also causes the isTouching(FlxObject.LEFT) to incorrectly be set as "false". He only overlaps the wall if you continually push left, and the character isn't moving too fast or anything that could cause him to propel into the wall.

Any thoughts?
« Last Edit: Wed, May 9, 2012 by azumaril »

auriplane

  • Snails!!
  • Contributor
  • ****
  • Posts: 497
  • Karma: +1/-0
  • Snails!!
    • View Profile
Re: Flixel 2.55 Left collision goes into wall?
« Reply #1 on: Wed, May 9, 2012 »
Is the object being updated before or after collision detection each frame?

bananas

  • Member
  • **
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Flixel 2.55 Left collision goes into wall?
« Reply #2 on: Wed, May 9, 2012 »
There's a bug with the collision on flixel, it's better if you write your own class to handle that

auriplane

  • Snails!!
  • Contributor
  • ****
  • Posts: 497
  • Karma: +1/-0
  • Snails!!
    • View Profile
Re: Flixel 2.55 Left collision goes into wall?
« Reply #3 on: Wed, May 9, 2012 »
What the OP described doesn't sound like a collision bug in Flixel.  It sounds like each frame, the game is colliding and separating the objects, THEN the character is moving and updating their position, THEN the game is drawing them.

If you change the overall order, so the character tries to move left, THEN the game collides and separates the character from the wall, THEN the game draws, then the character won't appear to be able to move into walls one frame's worth of distance.

That's what it sounds like to me, at least!

azumaril

  • Member
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Flixel 2.55 Left collision goes into wall?
« Reply #4 on: Wed, May 9, 2012 »
Is the object being updated before or after collision detection each frame?

I tried placing the collision and overlapping checks after the super.update() in my main class and that fixed the problem.

Thank you * infinity. You are a god among flixel gods. Btw, do you happen to live in NY?
« Last Edit: Wed, May 9, 2012 by azumaril »

auriplane

  • Snails!!
  • Contributor
  • ****
  • Posts: 497
  • Karma: +1/-0
  • Snails!!
    • View Profile
Re: Flixel 2.55 Left collision goes into wall? [SOLVED]
« Reply #5 on: Wed, May 9, 2012 »
Nope, I live in northern California!