z_impact
z_impact

scemino/z_impact

MIT

A 2d game engine written in ZIG

161600
2
build.zig.zon build.zig 
View on Github  
Updated: 8:10:08 PM Sun Sep 08 2024Size: 964KBCreated: 2:24:14 PM Sun Aug 18 2024
Dependencies:
sokolsdl
zig fetch --save git+https://github.com/scemino/z_impact

build

███████╗    ██╗███╗   ███╗██████╗  █████╗  ██████╗████████╗
╚══▓▓▓╔╝    ▓▓║▓▓▓▓╗ ▓▓▓▓║▓▓╔══▓▓╗▓▓╔══▓▓╗▓▓╔════╝╚══▓▓╔══╝
  ▒▒▒╔╝     ▒▒║▒▒╔▒▒▒▒╔▒▒║▒▒▒▒▒▒╔╝▒▒▒▒▒▒▒║▒▒║        ▒▒║   
 ░░░╔╝      ░░║░░║╚░░╔╝░░║░░╔═══╝ ░░╔══░░║░░║        ░░║   
░░░░░░░╗    ░░║░░║ ╚═╝ ░░║░░║     ░░║  ░░║╚░░░░░░╗   ░░║   
╚══════╝    ╚═╝╚═╝     ╚═╝╚═╝     ╚═╝  ╚═╝ ╚═════╝   ╚═╝   

░░░░▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓██████████████▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒░░░░╗
╚═════════════════════════════════════════════════════════╝
                                                       

Z impact is a ZIG game engine for creating 2d action games. It's well suited for jump'n'runs, twin stick shooters, top-down dungeon crawlers and others with a focus on pixel art.

This is NOT a general purpose game engine akin to Godot, Unreal or Unity. At this stage, it is also quite experimental and lacking documentation. Expect problems.

Z impact is more a framework than it is a library, meaning that you have to adhere to a structure, in code and file layout, that is prescribed by the engine. You do not call Z impact, Z impact calls you.

Games made with Z impact can be compiled for Linux, macOS, Windows (through the usual hoops) and for the web with WASM. There are currently two "platform backends": SDL2 & Sokol and different renderers: for SDL2 platform: OpenGL and for sokol: one renderer by OS: OpenGL (Linux), Metal (mac OS), Direct-X (Windows).

Z impact is a port of the orginal game engine high_impact made by phoboslab.

Examples

  • Biolab Disaster: A jump'n'gun platformer, displaying many of Z impacts capabilities.
  • Drop: A minimal arcade game with randomly generated levels

Compiling

To compile and run the sample game Drop

Linux - Windows - macOS

SDL2 platform

zig build run

sokol platform

zig build -Dplatform=sokol run

WEB

zig build -Dtarget=wasm32-emscripten run 

Documentation

There's not much at the moment. Most of Z impact's functionality is documented in the header files with this README giving a general overview. It's best to read the blog post for an overview and the source for all the details.

Assets

At this time, Z impact can only load images in QOI format and sounds & music in QOA format. The tools to convert PNG to QOI and WAV to QOA are bundled in this repository and can be integrated in your build step.

Game levels can be loaded from .json files. A tile editor to create these levels is part of Z impact: weltmeister.html which can be launched with a simple double click from your local copy.

Libraries used

License

All Z impact code is MIT Licensed, though some of the libraries come with their own (permissive) license. Check the header files.