Unnamed Platformer - Devlog 7
I typed words into a code editor and made shapes move around 
What I did: I finally took on the shape-switching system and got it working! I had to completely change how the player class worked, so I made it into a pure virtual class to handle polymorphism (which lets me switch between different shapes) and replaced the old static player setup with a dynamic shape-switching state w/ unique pointers. For shapes so far I implemented the circle with rolling physics and friction, and the triangle which can teleport forward a short distance. Also, keeping source code in header files was causing circular include errors, so I reorganized all the player class code into a brand new players.cpp file. And finally I made it so falling below the screen kills the player, which is a pretty small feature but still.
Pretty much what was happening was that I needed to access my tilesettings.h file in my players.h class for movement-related checks, but tilesettings.h also needed players.h for hitbox/collision stuff. So I had to take out my code from my player header file and move it to player.cpp, which was lowkey a nightmare since I ran into a bunch of compiler and linker errors that took me an hour to fix😭 Anyway, Gemini helped rescue me (since my Claude 5-hour limit somehow ended after the first question I asked it today), so thanks Gemini.
Challenges: Pretty chill today, since today was more designing and testing new features that were easy to implement; however the real nightmare was splitting my files. Moving code to players.cpp broke everything with a bunch of “multiple definition” linker errors. I didn’t define my global variables as inline at first, but since they were getting defined across many files I had mark them as inline. Also, the triangle’s teleport mechanic let you phase into solid tiles at first, so I made a position prediction system using swept AABB bounds. In fact, creating this swept check was the feature that needed me to call tilesettings.h in players.h in the first place, which led to my cortisol spiking when the compiler stopped working for an hour
AI used, if any: Used Gemini to help me figure out why the compiler+linker were throwing errors, and some basic debugging in my other features.
Plans for next time: I’m gonna design my other two shapes now (octagon and hexagon), then start making this into an actual game with multiple levels, progressing to the next level when you reach the finish, etc etc. Also, I feel like the sliding movement is kinda unnatural, but idk if I’m going to change it because I already have a whole system down and starting from scratch would be a chore. Anyway, I’ll think about it.
K bye guys
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.