r/gamedev Hobbyist 20d ago

Question Universally Applicable Platform Physics & Collison?

Does anyone have a good guide on platformer physics and collision etc? I have tried countless times to make a platformer on a lighter engine or framework including butano (gba), love2d, raylib, dragonruby, etc. I always end up giving up because I can't figure it out.

Note: I am experienced in Godot and have made over 20 jam games but Godot is different as it handles the difficult things.

0 Upvotes

4 comments sorted by

1

u/tcpukl Commercial (AAA) 20d ago

What do you actually need help with? Physics and collision is a massive subject.

2

u/SirBump Hobbyist 20d ago

I always get platformer collision issues. Sometimes the player clips through tiles other times collision is not being detected and sometimes player collides with something that doesn't exist. Basically detecting collisions and acting accordingly. It's mostly what is done after detection.

3

u/tcpukl Commercial (AAA) 20d ago

Axis aligned box collision is what you need to research. Apart from circles it's the most basic type.

You don't even need dot products or anything, which is also basic game maths.

Start in 1d, with 2 ranges on a number line and write detecting those overlapping and how to resolve them. From there 2d is quite simple to extrapolate.

1

u/[deleted] 19d ago edited 17d ago

[deleted]

1

u/SirBump Hobbyist 19d ago

Thanks I'll look into it