This game is INSANE for pico 8, especially because you didn't have the full amount of time. The level design is really cool in how it can be solved with each of the powerups. I've tried making games in PICO8, and I spent half the time figuring out how to get it to render to the screen! Anyways, I wish I came up with this idea first, so that I could use it!
Viewing post in X is RNG() jam comments
Thank you, though I definitely would not have be able to do this 2 years ago when I first started using Pico8, but since then I have made 4 platformers it (not including this or things I made in other engines/libraries/whatever), and each time I programmed it from scratch because I made it to intertwined with code unique for the game...
So you could say I have some practice!
(and the hardest thing is always getting collision in corners to work, as the x and y collisions don't like mixing, at least if you don't want the character hovering above the ground)
When I programmed collisions, I always had issues with the character clipping into corners. My system checked if there would be a collision on the x-axis, and then on the y, before applying the movement, like in this video:
The problem with this system was it didn't check diagonally, so i now apply the x axis once I find it is clear, so when I check on the y, it will take the updated x position into account. Basically, rather than checking both axis and THEN applying the movement, I check on just the X, apply it, and then check the Y. I don't know if this is the issue that you had, but I watched a flawed tutorial and was stumped by this for ages. I tried implementing other, hacky solutions which kinda worked. If this is your problem then hopefully it helps, otherwise i guess I've wasted a little bit of both of our times! Hope it helps thoMy problem most times is that because I check most of the character collision for the whole thing, if you go into a wall enough on both axes, it just puts you all the way out of an entire chink of tiles, as updating one axis the right amount won’t fix the other axis. I often use the old position on the opposite axis when calculating the first axis (though I think I just get lucky some times)
(Also, I wrote all this assuming we’re both talking about collisions where you push the character to the position they should be instead of reverting to the old position [also the vid doesn’t have a velocity more than 1 in each axis I think, so it doesn’t have to deal with that])
Edit: I don't think I made much sense, but to hopefully to make this clearer: the problems I have are mostly to do with going into walls with velocities that make it hard to tell exactly where the character has to be moved, as both axes have to move the character out the perfect number of pixels to make it look right, and you you don't hover or partially in the block.
The reason I didn’t spend much time on the character collision in this one because I just set the x to the old position instead of pushing you up against a wall (meaning you actually don't slide up all the way against a wall in most cases) ;)
Usually, I just revert back to an old position, which can be somewhat jarring when the character is in free-fall and is moving in large enough steps that it ends up floating. Overall, the video with the adjustment that I stated works well for me (: I often just ignore the slight "floating", where the character dellerates, just before hitting a surface. I don't know if it would be possible to adapt the video's system in order to feature quarter steps, like is used in mario 64. That could prevent the jarring. I'm sorry that I'm not more knowledgable on other systems, but the one in the video, maybe with a few adaptations seemed to work well for me. I actually used it in a previous game jam game (admittedly which is not as good as yours), but if you want to try it, you can play it here: https://ossoace.itch.io/find-fakes or here: https://www.zel.us/games/fake_find/. Hopefully it helps! And, I'll have a look into your system. It sounds interesting!
Well, my code is probably hard to read, and just reverts the x-axis to it's old position.
If you want to find a better system, I think this game of mine: https://void-gamesplay.itch.io/the-return-of-timmy-the-grappling-hook has a pretty solid collision system.
Anyway, thanks for the help! Its made me think a bit about collisions without barging head first into the code.