dng
dng is a maze/puzzle game + engine! Design and work your way through your own maze avoiding enemies and finding treasure!
How to run
To run the game you can just launch dng or dng.exe on windows.
Follow the onscreen prompts to load a level and play!
Configurations
By default the game will look for its configuration file in a few OS specific places.
The default config is bundled along side the executable: config.toml
Create your own level!
Levels use the following directory structure:
level-name/
dng.map # required -the map file
proc.lua # optional - custom lua overrides
Map Format
The map format is just a text file with the following key tokens:
| Token | Description |
|---|---|
| w | Wall |
| p | The player (must have 1) |
| e | Enemies (0 or more) |
| t | Treasure (0 or more) |
| 0 | Empty space |
Tips
Space your map out using whitespace between every token (w w w w instead of wwww) for better readability.
Use a monospace font to help things align
Custom Lua Code
Create a proc.lua in your level folder.
You can override anything found in dnglib using standard lua scoping rules.
If you wish to call the original defaults you can include dnglib.defaults in your file:
local defaults = require('dnglib.defaults') and call the functions:
package.path = '['
function onKeyPress(key)
-- Set your own overrides
defaults.onKeyPress(key)
end
Develop
dng uses git-submodules:
git clone https://github.com/s3nd3r5/dng
git submodules init
git submodules update
Dependencies
Current build process is setup for a *nix like environment.
| Dependency | Version |
|---|---|
| c++ | 20+ |
| g++ | 8+ |
| CMake | 3.16+ |
| Lua | 5.4.* |
| SFML | 2.5.* |
Note: with some CMake modifications we could probably leverage lower versions
Build
dng uses CMake
# use a build dir to ensure we ignore build props
cmake -B cmake-build
Developed with CLion using CMake and g++ on Linux
Enforcing local lua files
To ensure you're always loading the local files make sure you include:
package.path = "./?.lua;" .. package.path at the top of your proc.lua
If you're experiencing issues loading the proper files you can always set in your local development environment:
export LUA_PATH=/path/to/dng/?.lua; (replacing /path/to/dng with your actual local development path)
this will allow you to run dng from anywhere
Licensing in files
You can find a copy of the notice in .copyright_headers.
Note dnglib/constants.lua and src/lua.hpp which have custom licensing information.
Run
Once you build the project you can execute it by:
# use your build dir and select a map!
./cmake-build/dng
Note: You need to use the working directory containing the include folder!
External Libraries and Resources used by dng
- SFML licensed under zlib/png license
- Lua licensed under MIT license
- Press Start 2P Font licensed under SIL Open Font License
- Liberation Fonts licensed under SIL Open Font License