Actor touching the bottom of a platform/stopping a jump
MasakoX
Member Posts: 16
I'm still making the endless runner I mentioned in another post and I'm encountering a bug which could cheapen the experience.
If I jump below a platform and touch it it reset my jump count like if I landed on the top of it. I don't want that to happen and want a rule that if the top of the player touches the bottom pixel of the platform, then the player's jump count would be 0 and the player would lose.
How would I go about this? I've dabbled with this rule but come unstuck as it sometimes makes me stop jumping when I legitimately touch of the top of the platform.
If I jump below a platform and touch it it reset my jump count like if I landed on the top of it. I don't want that to happen and want a rule that if the top of the player touches the bottom pixel of the platform, then the player's jump count would be 0 and the player would lose.
How would I go about this? I've dabbled with this rule but come unstuck as it sometimes makes me stop jumping when I legitimately touch of the top of the platform.
Comments
If the players linear.velocity.Y is > 0 it's moving up so don't re-set the jump. This assumes your player would only be moving up when it's jumping.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
I'm actually using your 'Endless Runner' tutorial on your course as a base and adapted it from there.
I got my code for the player here - http://i44.tinypic.com/2crautv.png and here http://i42.tinypic.com/aza22t.png
Many thanks for your help.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
[URL=http://wikisend.com/download/342464/PixelatedEndlessRunner_v0.2b.zip]PixelatedEndlessRunner_v0.2b.zip[/URL]
I turned the Reset Jumps Rule off in your player and added a Rule like it to the two platform actors. This allows you to check to see if the player is above or below the platform since you were already tracking the players X and Y locations in a Game Attribute.
To make the players jumping still work right I added two new Game Attributes, Jumping and jumpCount. These are just like and perform the same function as the Actor Level Attributes you had by the same name. I just had to move them to Game Level so they could be accessed by the Platform actors when the players jump needs to reset. I added a couple notes in the platform rules so you can see what exactly I added.
It seems to be working fine now, check it out and let me know your thoughts.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page