Standing on the characters head



  • in a platformer game, I have all motion and gravity set to zero and immovable set to true for the character. However, when the player stands on the characters head, the player either slides to the left or right side depending on the size of that character and then the player falls to the side of that character. I would like the player to stand on the head of that character without moving. I am using a collide check.

    An open source retro style platform game made using Haxeflixel https://www.thespacecastle.org/

    0


  • In your Player class new() constructor try adding collisonXDrag = true;

    http://api.haxeflixel.com/flixel/FlxObject.html#collisonXDrag



  • You should have your immovable set to false



  • It seems that immovable was not needed. It was causing the player to move position at the collide function. I used animation.paused to determine if the character was standing still, i used a X and Y variable that refers to the position that the character was first frozen so that the character never moves.

    An open source retro style platform game made using Haxeflixel https://www.thespacecastle.org/

    0

Log in to reply