Nyaggin'

Bike Ryder

I have completely no idea why we would learn Win32 API, and why we are asked to use this framework which is totally unrelated to game-dev to develop a video game... It's just how the course is. Maybe it's something we should be proud of as a student of Communication University of China...

Anyways, we had a course about development with the C language and the Win32 API (I don't remember the exact name) that was going on in parallel with the course Game Creation. I thought, "Hey I won't learn it for nothing." So I decided to actually use the Win32 API to develop a game for the latter course.

Obviously, there's no way for me to directly build a agame out of pure Win32 API. I'd have to build some basic abstract facilities out of it first. So I went to do that:

Based on the existing types in the Win32 API, I managed to make some common must-have classes in game development:

  • A window manager (that mainly deals with Windows, and also distributes input events)
  • A game manager
  • A class for texture instances
  • A renderer base class
    • A sprite (basically a texture-variable renderer)
    • Texts (basically a bunch of texture-fixed renderers but can be layout(-ed? laid-out?))
  • Physics (Very simple physics, only applicable for this specific game)

And then based on these, I developed the playable game logics. The result looks like this:

It even supports simple scaling and sorting on the Z-axis!

If you're interested, here is the GitHub repository of the project. (You will have to compile the project yourself!)

But frankly speaking, I'm not quite satisfied with this abstraction layer.

Although it perfectly achieved the goal of implementing the game, it's heavily coupled with both the lower Win32 API and the upper game logics. I think for an ideal universal game engine (or let's just call it a framework for now), its design should be opaque for both the up- and downstream logics. That means, no matter what application you are implementing or upon what platform you are developing, the application logics can be implemented just regarding the framework itself, completely wiping off the differences between platforms.

Matter of fact, this is what Win32 API trying to (and already managed to) achieve between Windows application developers and the various versions of Windows system.

After realizing that, I started a new version of my framework which is used multiple times in latter course assignments.