C was actually the first programming language I ever learned. I studied it during high school and revisited it briefly at the beginning of undergraduate studies (Electrical Engineering). It made sense. I studied in a technical school in high school, so I had my first contact with Assembly and some PIC chips. But, somehow, it ended up sitting on a shelf in my programming toolbox for years! My course took a different path. But when I came to Japan and started a second Master's, now in Computer Science, programming turned into something common for me.
Since then, most of my projects have been written in languages like Python and Lua. The first one is the main language I use in my research, the second is the one I used the most in my game dev projects. Recently, however, I've found myself becoming increasingly interested in hardware and low-level systems. After doing some research, I realized that if I wanted to explore this world further, C was a language I really needed to become comfortable with again.So, I decided it was time for a reunion!
Learning by building something
But how do you get back into a programming language after years away? For me, the answer is always the same: find a project. Find something you like to do and do it! Lately, one of the things I've enjoyed programming the most is games. So I decided to take a game project I had previously been developing in LUA and move it to C.
I really liked playing Sekiro: Shadows Die twice, by FromSoftware. It was the first game from them that I played, and even though I took months to finish, I really liked the feeling of parry enemies! So I decided to take a game project I had previously been developing in Lua and move it to C.
That's how I discovered Raylib, which turned out to be a perfect fit.I really enjoy the kind of experience Raylib offers. It reminds me of programming with Lua in PICO-8: you have to implement many things yourself, but in exchange, you get much more control over what's happening. Don't get me wrong, I love game engines too! I regularly use Godot and Love2D. But sometimes, I just want to build things from scratch and understand every piece that makes them work.
Pointers, arrays, and a lot of debugging! I wasn't starting completely from zero. I already had some familiarity with C, and my experience with Python helped me feel more comfortable with things like explicitly declaring variable types.Still, I needed some help getting back on track. I used cheat sheets and tutorials, and LLMs became something like my personal Stack Overflow for quick questions and debugging ideas. However, when it came to understanding concepts such as pointers and arrays, I preferred going back to books and academic resources. Pointers, in particular, took some time to click. I got lost more than once trying to pass variables between functions and understanding what was actually being passed around.I'm still working on solidifying that knowledge, and my code is far from perfect. But there's something incredibly satisfying about seeing a character move across the screen and, even better, watching collisions work when you've implemented everything yourself.It's a small achievement, but a very rewarding one!
Don't worry, I do not intend to steal Goku! I'm a big fan of DragonBall and thought it'd be cool use these sprites from a GBA game as place holders. Specially since I'm mostly focusing on physics and mechanics now. And I'm really satisfied! Everything, from the player's movement to the collisions were hand-coded! I used state-machines pattern to control the character's transitions, and again, I'm really satisfied with the results up until now.
What's next?
I think the biggest impact of returning to C has been the feeling of programming closer to the hardware.I'm still planning to continue developing my game, but I'm already thinking about my next experiment. During my last trip to Akihabara, I picked up an ESP32-C3 board. I want to start using C to build a small virtual assistant that integrates temperature and accelerometer sensors, Wi-Fi, Bluetooth, and a small display.It's still an early idea, but I'm excited to explore it.Sometimes, learning something new isn't really about starting from scratch. It's about returning to something you once knew, seeing it from a different perspective, and discovering how much more you can do with it. And that's exactly what getting back to C has been like for me.
Don't get scared! HAHA! You can check how this project is here: https://github.com/non4to/YASOULS