Log In  

Cart [#cratesncrushers-0#] | Code | 2019-08-15 | License: CC4-BY-NC-SA | Embed
4

Version 0.1

I've made dozens of platformers in Flash. We had to write all of our own code for collisions back in those days and there was a lot of demand for moving platforms and crates.

Moving platforms are hard. It has to move itself and anything on it.

Crates are even harder. It's like a moving platform, but you can push it and the moving platform can carry it too.

Push Me Pull You

A push can become a branching path with many things responding to one request for movement. This engine handles only one knobbly branch at a time. If the collision doesn't have too many parts, it will get it right.

Ugh OOP

I made this engine using an object pattern so I could figure out how the hell to make it. Hopefully it's readable and if you hate objects that much then please optimize it and post your results. I'm more than happy to see this engine updated.

Bugs

The more contact points involved in a collision, the more code it takes to solve. The engine pushes the first thing it sees, it doesn't think about the consequences of a pyramid of crates stacked on your head with odd gaps and a random bit of wall in the middle. I once wrote a loop-solver that handles this but it was some heavy duty stuff, not Pico 8 material. Or prove me wrong, I'd be happy to see an engine that handles it without going full Box2D.

P#66704 2019-08-15 20:27 ( Edited 2019-08-15 21:08)


[Please log in to post a comment]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-09-15 12:24 | 0.013s | 2097k | Q:21