Author Topic: Colliding FlxTileblocks and FlxSprites  (Read 1063 times)

Liaf

  • Member
  • **
  • Posts: 19
  • Karma: +0/-0
  • yay!
    • View Profile
Colliding FlxTileblocks and FlxSprites
« on: Sun, Feb 21, 2010 »
Well it doesn't work. I tried to program a moving FlxTileblock which should just push my player (FlxSprite). But like every 10th time the tileblock is just passing through my player without ever colliding.
The Tileblocks width is 50 px, the height 10px and the loaded Image is 10x10 px (Don't know if this somehow matters)

Bennett

  • Member
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Colliding FlxTileblocks and FlxSprites
« Reply #1 on: Sun, Feb 28, 2010 »
same problem here.

Rybar

  • Contributor
  • ****
  • Posts: 279
  • Karma: +0/-0
    • View Profile
Re: Colliding FlxTileblocks and FlxSprites
« Reply #2 on: Sun, Feb 28, 2010 »
Try using a FlxSprite instead, make sure to set fixed =  true.
Check out the source for FlxCollisions, he has pushers/moving platforms in there:

http://github.com/AdamAtomic/FlxCollisions/blob/master/src/Pusher.as

Also check out Elevator.as.