Another Jumping Issue
goddessarowyn
Member Posts: 8
Ok, so I was able to figure out my problem with my previous question, however, now I am faced with the issue of:
If the actor jumps in a left or right direction, and the arrow key is let go in the middle of the jump, or if the actor gets hung up on a corner of a platform in front of it, the actors jump animation remains, instead of returning to the resting actor image when it is clearly on the platform.
How do I fix this, because I am having a total brain fart on it and haven’t a clue. I've tried creating a separate rule for the animation, but I think Im doing it wrong. Can someone please walk me through how to constrain the animation to stop when the actor lands on the floor?
I know I am extremely new at this, and I'm sorry for asking so many questions, but this problem is super frustrating and I just want to get through it and move on to the other fun stuffs. So, any and all help is greatly appreciated!
If the actor jumps in a left or right direction, and the arrow key is let go in the middle of the jump, or if the actor gets hung up on a corner of a platform in front of it, the actors jump animation remains, instead of returning to the resting actor image when it is clearly on the platform.
How do I fix this, because I am having a total brain fart on it and haven’t a clue. I've tried creating a separate rule for the animation, but I think Im doing it wrong. Can someone please walk me through how to constrain the animation to stop when the actor lands on the floor?
I know I am extremely new at this, and I'm sorry for asking so many questions, but this problem is super frustrating and I just want to get through it and move on to the other fun stuffs. So, any and all help is greatly appreciated!
Comments
You need to let the animation know when the jump button is no longer pressed by the sounds of it.
Have a look through these videos and see if theres anything in there that your after and i will try and help if i get time.
http://www.deepblueapps.com/gs-platform-engine-v3/
http://www.deepblueapps.com/plaform-engine-v2-template/
http://www.deepblueapps.com/platform-templates/
http://www.deepblueapps.com/ladders-template/
Darren.
http://www.deepblueapps.com/plaform-engine-v2-template/
The Super Mario Bros. type jump. Ive been able to get them to jump left and right in the arc that I want, but I can't seem to get the jumping animation to stop when I land on a platform, or if the button is no longer being pressed the animation just freezes in the position and falls towards the floor, and if it hits the edge or gets caught on a corner of a platform, the animation just freezes in the jumping animation and falls back towards the floor. How I have the general jump movement itself set up is:
~General Jump Motion~
If: Space Key is down AND self.JumpCount>0, then:
change attribute: self.Jumping to true
change attribute: self.JumpCount to self.JumpCount-1
Change Image: Right Jump
Animate Right Jump
change attribute: self.motion.linearVelocity.x to 500
And then this is what I have set for the Jumping Movement Rule
If: self.Jumping is true
Then:
~Right Movement Rule~
If: Right Arrow Key is down, then:
Change Image: Right Jump
Animate Right Jump
change attribute: self.motion.linearVelocity.x to 200
~Left Movement Rule~
If: Left Arrow Key is down, then:
Change Image: Right Jump
Animate Right Jump
change attribute: self.motion.linearVelocity.x to -200
And then, my collision rules are as follows:
~General Collide Rule~
Collide with Actor Tag: Floors
~Flag that I've touched Floors Rule~
When: Actor Collides with Actor tag-Floors
Then:
-Change Attribute: self.Jumping to false
-Change Attribute: self.JumpCount to 1
And then my general Left and Right Movements are:
~General Right~
If Right Arrow Key is up, then set self.motion.linearVelocity.x to 0
Otherwise: Change image to right facing
Animate walk
change attribute: self.motion.linearVelocity.x to 200
~General Left~
If Left Arrow Key is up, set self.motion.linearVelocity.x to 0
Otherwise: Change image to left facing
Animate left facing walk
change attribute: self.motion.linearVelocity.x to -200
Do I have something amiss here? Is there just too much going on, or is there something else I need to do to achieve the Mario style jump and land motion?