Post
A bit of background: Playdate has very basic collision detection which can't handle much other than AABB collisions. This means that there isn't a standard way of handling collision for the slopes which is a problem given that it won't be much of a game if you can fly straight through the obstacles.
To get around this, I defined a centre line and acceptable deviation per section (red lines in the video) and then all I had to do was calculate how far from this line the player is. If they're outside the acceptable deviation, they've hit a wall.
0 reposts0 likes
Instead I applied the force regardless of whether a collision occurred 🤦 So what you actually get is a little push each frame towards that centre line. Its easy to fix, but I also kinda like the idea of having an autopilot power-up, so maybe you'll see a less terrible version somewhere down the line