blog #programming

Further experimenting with non OOP PHP

Cleaned up the mess I posted yesterday. The code should be pretty self-explanatory now. First I introduced type classes to mimic C structs:

Experimenting with non object oriented PHP code

I'm working on a framework written in PHP and trying to keep the code simple by omitting the functional and object oriented approaches as much as possible. What I'm having in mind might be best defined as loose modular programming. It might lead nowhere good but that's why this is an experiment.

Confused about inheritance in PHP

Got another job that deals with PHP. I haven't used the language in years and admittedly not made much use of its object orientated facilities during the time I worked with it in the past. As expected even the later additions to PHP have their oddities and pitfalls. For example today I tried to implement the following

Dependencies sure are fun

Now that my website is static again I needed to put together a new script for the hit counter. It seems the data related to the last time this site was delivered statically was not very important to me at some point, because otherwise I would still have it stored somewhere.

Scene handling in Saturn Engine (WT)

After a rough start with teaching myself game programming I spent many hours of 2017 and 2018 working on a Tohou clone based on this tutorial. Eventually I made it to the point where I could almost call the program a game: you could move a sprite, shoot bullets, destroy enemies that shoot their own bullets and so on. But there was a problem: this was my first C program that incorporated more than a main function, so my general programming skills with the language were really shallow at the time. Naturally my codebase reflected that. Working with the code I had written felt far from pleasant, especially because I had locked myself in. Had I continued working on the game without rewriting the entire thing there would have been little room for me to try out new things and more advanced concepts. So I started over with the goal to write a more general engine that I could use as the basis for future projects as well. That was back in march. Setting up the basics (input handling, rendering, framerate control etc.) took me a while, but now I finally reached the point where I could write a new scene management system. Here's the main portion of my old main() function:

Implementing a prototype scanline filter in SDL was easier than I expected.