We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm trying to figure out how to make "human" to move, jump and "bump" like in Super Mario. So far I made basic velocity movement on X axis, collision with canvas edges, velocity += gravity (works fine), made jump. I added small random platforms to test jump, jumping on top of them is fine, the problem is human gets stuck on the side of platform.
I think there is a way to detect which side of platform human is colliding with, but I just can't figure it out yet :) pls help :)
P.S. I can give some code if needed :)
Answers
To even start helping you, I would need to write code to move a thing about, that has velocity and gravity and boundaries and then - maybe - I can see what your problem is based on your brief description. That is a ton of work for probably no payoff. And you already have it done, and could post your code that shows the problem.
Yeah, I think YOU SHOULD POST YOUR CODE.
Please do share your code.
Here is how to format it on the forum:
https://forum.processing.org/two/discussion/15473/readme-how-to-format-code-and-text
I haven't run your code. One common cheat in this situation is to make the character 'bounce' when a collision is detected. I've not used the library, but you could try this:
In this case you don't need to know the side that was hit: you simply reverse the direction of travel... The only problem you may have is that the play library may internally have already set velocity to 0 on collision :/