add new maps, persistent storage, music toggle button

This commit is contained in:
2026-11-21 14:56:05 +03:00
parent bc7b137adb
commit 5b473d15f2
24 changed files with 2142 additions and 9 deletions

View File

@@ -7,7 +7,7 @@
(import audio)
(pub import tmx)
(define MAP-FILE "res/tilemaps/SaveAss.tmx")
(define MAP-FILE "res/tilemaps/start.tmx")
#-emscripten (define WIN-WIDTH 1440)
#-emscripten (define WIN-HEIGHT 900)
@@ -175,7 +175,7 @@
(= (. state player x) (clamp-to-grid (. state player x)))
(= (. state player y) (clamp-to-grid (. state player y)))
(= (. state fishing-spots) (tmx-object-group (. map handle) "fishing_spots"))
(= (. state fishing-spots) (tmx-object-group (. map handle) "fishing-spots"))
(= (. state near-fishing-spot) false)
(= (. state fishing-minigame-active) false)
(= (. state bobber-y) 0.0f)
@@ -286,8 +286,7 @@
(BeginMode2D (. state cam ray-cam))
(animate-tmx (. state map))
(draw-tmx-layer (. state map) "bg" (& (. state cam ray-cam)))
(draw-tmx-layer (. state map) "objects" (& (. state cam ray-cam)))
(draw-tmx (. state map) (& (. state cam ray-cam)))
(EndMode2D)
(DrawText (TextFormat "WASD/arrows: move X near fishing spot: fish ESC: back to menu Fish caught: %d" (. state caught-fish))
@@ -345,7 +344,7 @@
(= (. state player gid) (+ 3 (. state player-first-tile-gid))))
;; Rotate in any case, but move only if can
(if (! (tmx-is-tile-walkable (. state map) "bg"
(if (! (tmx-is-tile-walkable (. state map) "background"
(+ (* dx TILE-SIZE) (. state player x))
(+ (* dy TILE-SIZE) (. state player y))))
(return))