cschladetsch / xiq

A QIX Clone written from scratch on Linux using just video- and audio-buffers.
3 stars 2 forks source link

XIQ - A QIX clone written quickly

This is a very simple game based on the old arcade game, Qix.

Title

Now, this may seem like a really small, trivial and badly written game. And it is.

However it is written with practically no 3rd-party library source or components. It uses a framebuffer of pixels, and a sound buffer of unsigned 8-bit bytes. These are provided by SDL, as well as input.

Nothing else is used. So when a line has to be drawn, I had to write a line-draw algorithm. Want to draw a circle? Then write the algorithm to plot the points of a circle (quickly).

When a sound effect had to be played, I had to write the sound values directly to the byte array for the sound buffer.

There is a custom FontLibrary as well. As well as an ObjectFactory and GamePhase management system.

Basically, I wrote this to see what I could with the following self-imposed limitations:

  1. A framebuffer of R8G8B8A0 pixels.
  2. A sound-buffer of unsigned 8-bit bytes.
  3. An input system that I could poll for key down/key up.
  4. One weekend.
  5. And absolutely nothing else.

So, it's a simple, badly-drawn game with no fancy graphics or sound or music or fonts. But it has graphics and sound and music and fonts, all custom made from the ground up.

Instructions

I know there's a problem with the game area being half the screen. That's a consequence of the 23-minute port from SDL1 to SDL2 and can't see much point fixing it.

Build Instructions

Linux

$ sudo apt install cmake libsdl2-dev
$ mkdir -p build && cd build
$ cmake ..
$ make
$ cd .. && build/xiq

Windows

Projects for VS2017 and VS2019 are included.