Hi guys,
My latest game is a platformer and I’m having trouble with the character’s movements being responsive. Basically the game’s character can only jump and roll (left or right). My problem is that these should only be available when the character is standing on the ground (or rolling). I’m currently checking the velocity of the character’s body if the x & y values are low enough so as to assume that the character is on the ground.
The thing with this method is that the responsiveness of the game suffers. If I let the character jump twice with fast input commands, the 2nd one usually fails to be detected since the guy is still shaking a bit from the impact of the landing. Does anyone have a better solution to detecting whether a body is on the ground?
I was thinking of adding a “wrapper” body just outside the body of the character which can be a sensor. The sensor can just detect by using collision listeners whether or not the body is on the ground. One issue is that I can only listen for collision events, but when the body lifts gets off the ground (either by falling off the side by rolling, or jumping), I wouldn’t be able to detect where it is. [import]uid: 144908 topic_id: 30319 reply_id: 330319[/import]
[import]uid: 144908 topic_id: 30319 reply_id: 121598[/import]