A 2D platformer with a main mechanic of flipping gravity
archive project
Add support for windows cross build
draw colliders, add spikes


browse  log 



You can also use your local clone with git send-email.

#frivolous gravitas

frivolous: of little weight

gravitas: high seriousness

frivolous gravitas is a 2D platformer game that focuses on flipping gravity as it's main mechanic.

This game is made with SDL2.


The code has become somewhat unmanageable. I'm in collision hell. For every change I make there's some weird edge case that messes something else up. I'm still not sure if I implemented my timestep correctly. The game is not very performant and the windows build is super slow for some reason (at least through wine).

I learned a lot. I built this from the ground up with SDL and C++. The game works, and the later levels are actually challenging. But it's not up to my standards. The movement feels slightly off, but overall I think it's pretty good. The problems come from collisions with the objects. Riding / moving on the platforms feels weird. Again, the collision code is a mess (see Player.cpp@move). Overall I think this was a good first step towards developing a platformer.

I also discovered Tiled, a map editor, and tileson, a C++ header-only library. I don't think I would use tileson again. There were odd bugs with it like sometimes objects loading wrong positions (or maybe I was converting them to SDL incorrectly?), and every single file must end with a .json (even templates). This made my Tiled productivity pretty slow, which is already fairly slow to begin with. I don't seem to like drag and drop editors, but once the pieces are in place it's pretty nice.

SDL overall is pretty good but it has some weird issues too. There is basically no documentation for it, and most tutorials are ancient. I still don't know what event.key.repeat means or why it works the way it does in my code. I wish I found any sort of examples about how to handle collisions.

C++ was fun to work with at first, but I had a lot of questions throughout developing the game. Mostly I was wondering about the standards on using a C library. Do I use C++ standards like nullptr with these values from the C library (SDL)? Classes are weird and overall initially confusing. Extending a class should be public (or at the very least protected) by default in my opinion. There are good things about C++. I think the standard library is quite good. I'm unsure about using exceptions in anything but backend web development. Overall I think it's a decent language. But I think it has a lot of weird things that you will likely never remember until they are a problem again. I didn't have that problem with C. Perhaps C with a good library added on would be a better option for me.

I'm currently looking into Love2D, HaxeFlixel, and Tilengine as options for games now.