diff options
author | Steph Enders <smenders@gmail.com> | 2022-06-15 23:36:43 -0400 |
---|---|---|
committer | Steph Enders <smenders@gmail.com> | 2022-06-21 15:20:33 -0400 |
commit | 09615be926efb7302bc348aa66feccb694b23ba8 (patch) | |
tree | 0adf5eeb39312649c4adc288e051d5251428a2c2 /README.md |
v0.1.0 - Initial Commit
Create dng - a maze/puzzle game enging using Lua and SFML
---
Initial setup commit
This setups up the project for messing around with C++ and Lua bindings.
So far this project just prints the defined dng map and lets you move
the character around.
What this fails to do is actually provide any reason to use Lua at the
moment. So I need to figure out some way of enabling logic on the
processing side of things.
Fixup warning from IntelliJ
Added onUpdate logic to move the enemies etc
Created some algorithm logic for enemy movement
Allowed for default overrides
Made shortest path alg more efficent
In the previous commit this algo waited until the "success" step came up
in the queue. Now we have the check during the push - and if an hits we
return true from the push_moves fn.
Since we're only interested in the initial move (since we check moves
every frame) we can only return true and then use the current step as
the origin position to diff against the start to get the dx,dy
Add scene controls and win/loss scenarios
Setup ability to check collisions and transition game scene
Remove SFML for now
Create level 2
Fixup - Can now have levels without a proc.lua
Checked existence of wrong file for loading defaults
Add readme and ignore build files
Setup so it can build on debian
Reformat bill merge
Make installable
You can now do: `sudo make install` and have it publish and distribute
the dng lua files to the share dir
Bump version to 0.3.1
Opps forgot to unignore dng folder
Force local version if in current dir
This should allow development to ALWAYS prefer the local version of the
lib - so if you have an installed version it won't override local
changes
Set version to 0.3.2
Bump version to 0.3.3
Update to use SFML (for gameplay)
Intro/Win/Loss not supported yet
Remove install logic for now + make mov overrides
Allow for restart on win/loss
Add scroll viewport and max window sizes
Display win/loss (need restart view fix)
Fix recenter view on restart
v0.4.0 - SFML
Dynamic text rescale
This isn't the best since we rescale it every frame we render it on, we
should render all the text once and remember it.
If we want to support "resizing" we can do that in its own logic loop
MessageBox + Filesystem lookups for files
Created MessageBox which is a helper class to allow for printing any
dialog in a scalable way.
Added path overrides for lua files as well as the ability to seek the
filesystem for specific paths for the fonts and such.
Set version to 0.4.2
Creating submodules?
Added SFML as third party lib
Use git submodules for dependencies
Set license to zlib/png
Add thirdparty licenses and include in package
Set version to 0.1.0
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..72c7c9f --- /dev/null +++ b/README.md @@ -0,0 +1,134 @@ +# 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 + +You can run the game by `dng path/to/map/lvl` + +To run the first level: + +`dng maps/lvl1` + +## Create your own level! + +Levels use the following directory structure: + +```shell +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: + +```lua +package.path = '[' +function onKeyPress(key) + -- Set your own overrides + defaults.onKeyPress(key) +end +``` + +## Develop + +dng uses git-submodules: + +```shell +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 + +```shell +# 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: + +```shell +# use your build dir and select a map! +./cmake-build/dng ./path/to/map/lvl +``` + +To launch level 1 for example: + +```shell +./cmake-build/dng ./maps/lvl1 +``` + +Note: You need to use the working directory containing the `include` folder! + +## External Libraries and Resources used by dng + +* [SFML](https://github.com/SFML/SFML) licensed + under [zlib/png license](https://www.sfml-dev.org/license.php) +* [Lua](https://github.com/lua/luat) licensed under [MIT license](https://www.lua.org/license.html) +* [Press Start 2P Font](https://fonts.google.com/specimen/Press+Start+2P#glyphs) licensed + under [SIL Open Font License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL) +* [Liberation Fonts](https://github.com/liberationfonts/liberation-fonts) licensed + under [SIL Open Font License](https://github.com/liberationfonts/liberation-fonts/blob/main/LICENSE) |