Tile Based Constrain Collision [SOLVED] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Tile Based Constrain Collision [SOLVED]

I am working up to making a platformer game, although a problem I have is collision (again) but this time a different type. How could I implement tile based constrain collision? By that I mean, when the player lands on a ground tile, it stays there instead of bouncing off. I tried setting the y-velocity (speed it falls) to 0. But If I'm too high, it gets pushed in the ground. How can I make an object 100% solid. Example (jump multiple times to see what I mean) https://code.sololearn.com/WSC3JL587LQ2/?ref=app

29th Jun 2019, 7:02 AM
Clueless Coder
Clueless Coder - avatar
4 Answers
+ 5
Coder Sorry
29th Jun 2019, 4:21 PM
Clueless Coder
Clueless Coder - avatar
+ 5
Coder I am starting a fresh now. I am making a clone of my platformer code but this it has a built in collide function and tiles instead of long platforms. It shoupd be more readable. I'll keep you updated if anything happens.
30th Jun 2019, 9:02 AM
Clueless Coder
Clueless Coder - avatar
+ 5
Coder Sadly, even using your example it won't work properly. It has results, although the lowest platform is very off center, top and bottom are reversed (weirdly) and gravity stops working once you are off the platform. https://code.sololearn.com/WSC3JL587LQ2/?ref=app
30th Jun 2019, 11:33 AM
Clueless Coder
Clueless Coder - avatar
+ 5
Coder 🤦I feel so stupid 😂. Thanks for your patience.
30th Jun 2019, 12:09 PM
Clueless Coder
Clueless Coder - avatar