Jumping and Side Collisions
I have created an actor and jumping works fine when my actor is on top of a solid. If, however, my actor collides with a solid whilst mid jump, my actor lands and the jump button no longer functions. Is there a way to get my actor to jump again after a mid air collision with a non-moving actor?
My jump is set up like this:
I have added an integer attribute 'Jumps' set to '0'
Actor receives event - key - space
Attribute - self.jump > 0
Change attribute - Self.Motion.Linear Velocity.Y to 400
Change attribute - Self.Jumps 0
Actor receives event - overlaps or collides with - actor of type - solid
change attribute - self jumps - 1
Thanks
My jump is set up like this:
I have added an integer attribute 'Jumps' set to '0'
Actor receives event - key - space
Attribute - self.jump > 0
Change attribute - Self.Motion.Linear Velocity.Y to 400
Change attribute - Self.Jumps 0
Actor receives event - overlaps or collides with - actor of type - solid
change attribute - self jumps - 1
Thanks
Comments
Once my actor hits the wall mid-jump and falls down to the floor, even after moving backwards and forwards along the floor platform, when I press the space bar (the jump button) nothing happens.
...or maybe the logic could be changed.
Why greater than 0?
Shouldn't it be less than 2?
I'd probably use a floor sensor.
If floor sensor overlaps or collides with actor tagged (Floor)
Set Jump to 0
If space is pressed and Jump is < 2
change Jump to jump+1
change linear velocity to +400
I'm kinda sleepy, so my logic might not be right, but I'm thinking that's the approach I'd try for wall jumping.
I'll have a play around with what you suggested later and report back.
Thanks for taking the time to answer my question.