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 initfollowed by
git submodule update
zig build play
- arrow keys: move
- space: shoot
- esc: leave game
- m: toggle sound muting
- 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
Oxid uses a minimalistic Entity Component System, which is certainly overkill for a game like this, but for me it's a experiment in itself.
Here are the main gameplay-related files:
- src/oxid/components.zig - struct definitions of each component type
- src/oxid/frame.zig - calls into systems
- src/oxid/game.zig - component type registration
- src/oxid/prototypes.zig - entity spawning functions
- src/oxid/systems/*.zig - all of the systems (i.e. think functions)
The ECS framework itself is located in
src/common/gbe/. 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.zigand register it in
- To add an entity prototype, add a function to
- To add a system, add a file to
systems/and import/call it in
Adding new graphics, sound effects, or input bindings is not as polished but still relatively easy. Documentation to come later.
Low-level graphics code was originally based on andrewrk's Tetris demo for Zig.
Sound effects from https://opengameart.org/content/512-sound-effects-8-bit-style