Is There Such a Thing as an Easy C Game Engine?

Words
286
Reading
2 min
Listen
Play
2y

image.png

I’ve already stated that I love Python for, well, pretty much 80% of my programming.

That includes game development as you might have seen in past articles.

That’s all great apart from situations where you want to deploy a single compiled executable or where the rest of your code is already being developed.

My C-based dungeon game is in that exact situation so I have been considering my options.

Fortunately my needs are extremely simple, so simple in fact that I considered using one of the many GUI frameworks.

After all, the game is “tile based”, meaning all the game objects and the player are positioned on a grid like chess pieces.

In the past I’ve used SDL, which is up to version 3 now, and I know that works with Emscripten allowing compilation for the web, making it truly cross-platform for modern devices.

But I’ve heard great things about Raylib.

I hadn’t realised that Raylib games can also be compiled to WASM in the same way, plus is compatible with Mac, Windows, and Linux.

There are a lot of helpful and powerful added abilities that I’ve not even looked into yet too.

So far all I’ve done is got a sprite moving around under keyboard control over a basic tile map but I’m happy so far.

Prerequisites

Before we begin, ensure you have the following installed:

  • Git CLI – You can install it by downloading from the official Git website.
  • C/C++ Compiler – We’ll use GCC, but Clang or MSVC will also work.
  • Make – Required for building projects; available through your system’s package manager.

Install Linux drivers

sudo apt install libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev

Cross-platform quickstart

Rather than compile Raylib myself I started with the QuickStart GitHub repo:

git clone https://github.com/raylib-extras/raylib-quickstart.git raylibdemo
Is There Such a Thing as an Easy C Game Engine? | Ecency