Skip to content

bb010g/oxid

Repository files navigation

Oxid

Oxid is an arcade-style game where you fight waves of monsters in a fixed-screen maze. This is more or less a clone of Verminian Trap (2013, Locomalito). Verminian Trap was originally inspired by Wizard of Wor (1980, Midway). Oxid is currently not nearly as fun as Verminian Trap, see TODO.md for planned features.

Oxid is written in the Zig programming language.

How to play

  • Install SDL2 and libepoxy
  • Install Zig (get it from master, version 0.2.0 is too old)
  • Depending on your version of Git, you may have to explicitly update the submodules: git submodule init followed by git submodule update
  • zig build play

Game controls:

  • arrow keys: move
  • space: shoot
  • esc: leave game
  • m: toggle sound muting

Debug/cheat controls:

  • backquote: fast forward
  • return: skip to next wave
  • F2: toggle rendering of move boxes
  • F3: toggle invulnerability
  • F4: toggle profiling spam
  • F5: cycle through preserved graphics glitches

Screenshot

Screenshot

Code

Oxid uses a minimalistic Entity Component System. Here are the main gameplay-related files:

The ECS framework itself is located at src/gbe*.zig. It is small but quite rough and somewhat opaque as it involves a fair bit of metaprogramming.

Actually using the ECS requires very little boilerplate.

  • To add a component type, add a struct to components.zig and register it in game.zig.
  • To add an entity prototype, add a function to prototypes.zig.
  • To add a system, add a file to systems/ and import/call it in frame.zig.

Adding new graphics, sound effects, or input bindings is not as polished but still relatively easy. Documentation to come later.

Notes

Low-level graphics code was lifted from andrewrk's Tetris demo for Zig.

Sound effects from https://opengameart.org/content/512-sound-effects-8-bit-style

Uses Dawnbringer's 16-colour palette.

Uses my zigutils and zig-comptime-pcx libraries.

About

Arcade style game written in Zig

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published