Jumping through platforms& landing on top, only when bottom of player collides with top of platform?
Hi!
I have a game where the player moves up, jumping through and on top of platforms. I have a code set up for the player that changes its velocity upwards when its moving down and overlaps/collides with the platform:
If attribute self.motion.linear velocity.Y > 0, then change attribute game.Moving up? to True, otherwise change attribute game.Moving up? to False
If attribute game.Moving up? is false and if actor overlaps or collides with platform, change velocity (direction 90, speed 800 relative to scene)
So when I have the code set up like this, if the top of the player collides with the bottom of the platform its velocity changes. I want the velocity to change only when the bottom of the actor collides with the top of the platform.
I've tried a lot of tutorials but when I add the change velocity behavior it doesn't work!
I have a game where the player moves up, jumping through and on top of platforms. I have a code set up for the player that changes its velocity upwards when its moving down and overlaps/collides with the platform:
If attribute self.motion.linear velocity.Y > 0, then change attribute game.Moving up? to True, otherwise change attribute game.Moving up? to False
If attribute game.Moving up? is false and if actor overlaps or collides with platform, change velocity (direction 90, speed 800 relative to scene)
So when I have the code set up like this, if the top of the player collides with the bottom of the platform its velocity changes. I want the velocity to change only when the bottom of the actor collides with the top of the platform.
I've tried a lot of tutorials but when I add the change velocity behavior it doesn't work!
Comments
if (character.y > platform.y + (character.size.height / 2) and collision detected) then change your velocity