How to turn off collision in HaxeFlixel

171 Views Asked by At

Im making a brick breaker like game and when I try to remove the brick, I remove the sprite, but not the collision. In new to HaxeFlixel so I don't have a clue why this is happening. Can somebody please help me? (code below)

1

There are 1 best solutions below

0
On

The remove() function removes the object from the state, which is causing the odd behavior. You only want to disable the object.

Try changing the line remove(brick) to instead brick.kill() and see if that resolves your collision problem.