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 acollide
check.
-
In your Player class new() constructor try adding
collisonXDrag = true;
http://api.haxeflixel.com/flixel/FlxObject.html#collisonXDrag
-
You should have your
immovable
set tofalse
-
It seems that
immovable
was not needed. It was causing the player to move position at thecollide
function. I usedanimation.paused
to determine if the character was standing still, i used aX
andY
variable that refers to the position that the character was first frozen so that the character never moves.