summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2022-03-21 21:48:11 -0600
committercflip <cflip@cflip.net>2022-03-21 22:13:14 -0600
commit52a1ea81be11b8860e7f2b7141fcaf2329630b9f (patch)
tree45f70e7ec23837f520ae658f1e3cceba133f99f7 /src/main.cpp
parent0b7ad904f819293b5d5e6ab22d40f331ab94eea3 (diff)
Implement simple level saving and loading
For now, it just reads and writes the width, height, and tile data to 'level.non'
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9281b2c..152021e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -65,6 +65,15 @@ int main(int argc, char** argv)
hoveredTile = ScreenToTile({ mx, my });
});
+ window.onKeyDown([&](int keycode) {
+ if (keycode == 's') {
+ level.save();
+ }
+ if (keycode == 'l') {
+ level.load();
+ }
+ });
+
while (!window.shouldClose()) {
window.update();
bitmap.clear(0xff224466);