A comfortable framework for game development which melds SDL2 and the Wren scripting language, written in C.
For more information on how to use DOME and get started, read the docs here.
You can download production-ready binaries from our Releases page. This is the recommended method for distribution and easy development.
Alternatively, if you have Homebrew installed (Mac OS X, Linux and WSL), you can install DOME using the following commands:
> brew tap domeengine/tap
> brew install dome
Finally, if you want to build DOME yourself, to make modifications or other reasons, follow these instruction instead.
Ensure you have the shared SDL2 libraries installed on your system first, then to build, run:
> make
This will create an executable named ./dome
(on Mac OS X and Linux), and ./dome-x32.exe
or ./dome-x64.exe
.
Run ./dome [gamefile.wren]
to run your game. If your initial file is called main.wren
, just running ./dome
will execute it. Replace dome
with your built binary name as necessary.
Your game's entry point must contain a Game
variable which contains at least init()
, update()
and draw(_)
methods.
import "input" for Keyboard
import "graphics" for Canvas, Color
class Game {
construct new() {}
init() {
_x = 10
_y = 10
_w = 5
_h = 5
}
static update() {
if (Keyboard.isKeyDown("left")) {
_x = _x - 1
}
if (Keyboard.isKeyDown("right")) {
_x = _x+ 1
}
if (Keyboard.isKeyDown("up")) {
_y = _y - 1
}
if (Keyboard.isKeyDown("down")) {
_y = _y + 1
}
}
draw(alpha) {
Canvas.cls()
var color = Color.rgb(171, 82, 54)
Canvas.rectfill(_x, _y, _w, _h, color)
}
}
var Game = Main.new()
DOME provides the following modules/methods/classes:
- Graphics
- Canvas
- Rect
- Point
- Circle
- Lines
- Color
- ImageData
- Draw sprites loaded from files (png)
- Canvas
- Input
- Keyboard
- Mouse
- Gamepads
- Filesystem
- File reading and writing
- Audio (stereo and mono OGG and WAV files only)
You can follow my progress on implementing DOME on my twitter.
- Graphics
- Triangles
- IO
- Asynchronous Operations
- Audio and Graphics also
- Network Access
- UDP
- HTTP client (maybe)
- Security sandboxing (maybe)
DOME currently depends on a few libraries to achieve it's functions.
- Wren (This is built by
make
automatically) - SDL2 (version 2.0.12 or newer, please install separately when building DOME from source)
- utf8.h
- stb_image
- stb_image_write
- stb_truetype
- stb_vorbis
- microtar
- optparse
- jo_gif
- tinydir
- ABC_fifo (A SPMC threadpool/task dispatching FIFO I wrote for this project)
- mkdirp
Apart from SDL2, all other dependancies are baked in or linked statically. DOME aspires to be both minimalist and cross platform, so it depends on as few external components as possible.
- Bob Nystrom for creating Wren and inspiring me to make games, thanks to Game Programming Patterns
- Special thanks to lqdev for the fantastic logo!
- Glenn Fiedler for the most referenced resources on Game Loops, Physics and Networking in games
- Casey Muratori for creating Handmade Hero, an inspiration and educational resource that makes this project possible.
- Built-in font comes from here.
- Sean Barrett for multiple libraries
- rxi for microtar
- Neil Henning for utf8.h
- Chris Wellons for optparse and pdjson
- cxong for tinydir
- Jon Olick for jo_gif
- Stephen Mathieson for mkdirp
- Example game and graphics are derived from this fantastic PICO-8 tutorial.
- Aerith's Piano Theme (res/AerisPiano.ogg) by Tanner Helland is available under a CC BY-SA 3.0 license: Link
- Game Over Theme (res/music.wav) by Doppelganger is available under a CC BY-SA 3.0 license: Link
- Font "Memory" is provided by Eeve Somepx, and is available on their patreon here under a common sense license.