Compare commits

...

8 Commits

Author SHA1 Message Date
e28b85a7fa clean release.zip too 2026-11-22 19:22:27 +03:00
efa08b3f03 add web-pack target to Makefile 2026-11-22 19:15:29 +03:00
89ca768c48 fix fishing popup back and magnet images
so they would be centered properly
2026-11-22 19:15:01 +03:00
758ddbd44e add new fishing popup 2026-11-22 18:28:12 +03:00
a13e3c4166 add back fishing zones 2026-11-22 17:59:42 +03:00
f094877001 make music toggle button graphic instead of text 2026-11-21 17:29:48 +03:00
fdc297489e remove ground under lake on start.tmx 2026-11-21 16:39:53 +03:00
24cedeef9d fix browser scroll by consuming arrow press events 2026-11-21 15:32:41 +03:00
8 changed files with 154 additions and 90 deletions

View File

@@ -85,6 +85,13 @@ web/index.html: $(WEB_OBJECTS) main.sex shell.html web/libraylib.web.a
web: web/index.html web: web/index.html
web-pack: web release.zip
release.zip:
mkdir -p web-pack
cp web/index.html web/index.wasm web/index.js web/index.data web-pack
zip release.zip -r web-pack
serve: web serve: web
python3 -m http.server -d web 8000 python3 -m http.server -d web 8000
@@ -94,5 +101,6 @@ clean:
$(MAKE) -C $(RAYLIB_SRC) clean $(MAKE) -C $(RAYLIB_SRC) clean
rm -rf ./build ./web rm -rf ./build ./web
rm -f $(OBJECTS) catch-phase rm -f $(OBJECTS) catch-phase
rm -f release.zip
.PHONY: all clean .PHONY: all clean web-pack

118
game.sex
View File

@@ -17,9 +17,7 @@
(define FISHING-POPUP-WIDTH 480.0f) (define FISHING-POPUP-WIDTH 480.0f)
(define FISHING-POPUP-HEIGHT 560.0f) (define FISHING-POPUP-HEIGHT 560.0f)
(define FISHING-POPUP-PADDING 32.0f) (define FISHING-POPUP-PADDING 32.0f)
(define BOBBER-WIDTH 28.0f)
(define BOBBER-HEIGHT 36.0f) (define BOBBER-HEIGHT 36.0f)
(define FISH-GAP 20.0f)
(define FISH-SPEED 0.75f) (define FISH-SPEED 0.75f)
;; Physics is expressed in abstract units; this maps them to popup pixels ;; Physics is expressed in abstract units; this maps them to popup pixels
@@ -65,7 +63,9 @@
;; Caught fish counter ;; Caught fish counter
(caught-fish int) (caught-fish int)
(fish-texture Texture2D))) (popup-back Texture2D)
(popup-magnet Texture2D)
(popup-target Texture2D)))
(ops camera (ops camera
(fn init ((self (* camera))) void (fn init ((self (* camera))) void
@@ -137,7 +137,9 @@
(pub fn mk-game ((app-state (* app-state))) page (pub fn mk-game ((app-state (* app-state))) page
(var state _ (mem-alloc game-state)) (var state _ (mem-alloc game-state))
(= (. state app-state) app-state) (= (. state app-state) app-state)
(= (. state fish-texture) (LoadTexture "res/img/small-fish.png")) (= (. state popup-back) (LoadTexture "res/img/fishing-popup-back.png"))
(= (. state popup-magnet) (LoadTexture "res/img/fishing-popup-magnet.png"))
(= (. state popup-target) (LoadTexture "res/img/fishing-popup-target.png"))
(audio-play-game-music) (audio-play-game-music)
(var map (* tmx-map) (load-tmx MAP-FILE)) (var map (* tmx-map) (load-tmx MAP-FILE))
@@ -194,8 +196,12 @@
(pub fn rm-game ((state (* game-state))) void (pub fn rm-game ((state (* game-state))) void
(unload-tmx (. state map)) (unload-tmx (. state map))
(if (IsTextureValid (. state fish-texture)) (if (IsTextureValid (. state popup-back))
(UnloadTexture (. state fish-texture))) (UnloadTexture (. state popup-back)))
(if (IsTextureValid (. state popup-magnet))
(UnloadTexture (. state popup-magnet)))
(if (IsTextureValid (. state popup-target))
(UnloadTexture (. state popup-target)))
(free state) (free state)
(return)) (return))
@@ -204,7 +210,57 @@
;; Dim the game behind the popup ;; Dim the game behind the popup
(DrawRectangle 0 0 WIN-WIDTH WIN-HEIGHT (Fade BLACK 0.5f)) (DrawRectangle 0 0 WIN-WIDTH WIN-HEIGHT (Fade BLACK 0.5f))
(GuiPanel popup "Fishing") (if (IsTextureValid (. state popup-back))
(DrawTexture (. state popup-back)
(cast (. popup x) int)
(cast (. popup y) int)
WHITE)
(GuiPanel popup "Fishing"))
;; Magnet hangs from the top of the popup and marks the bobber position.
(var bobber-bottom float
(- (+ (. popup y) (. popup height))
FISHING-POPUP-PADDING))
(if (IsTextureValid (. state popup-magnet))
(do
(var magnet-width float (cast (. state popup-magnet width) float))
(var magnet-height float (cast (. state popup-magnet height) float))
(var magnet-x float
(+ (. popup x)
(/ (- (. popup width) magnet-width) 2.0f)))
(var magnet-y float
(- bobber-bottom
magnet-height
(. state bobber-y)))
(BeginScissorMode (cast (. popup x) int)
(cast (. popup y) int)
(cast (. popup width) int)
(cast (. popup height) int))
(DrawTexture (. state popup-magnet)
(cast magnet-x int)
(cast magnet-y int)
WHITE)
(EndScissorMode)))
;; Target arrows move vertically over the same range as the magnet.
(if (IsTextureValid (. state popup-target))
(do
(var target-range float (fishing-bobber-range))
(var target-width float (cast (. state popup-target width) float))
(var target-height float (cast (. state popup-target height) float))
(var target-x float
(+ (. popup x)
(/ (- (. popup width) target-width) 2.0f)))
(var target-center-y float
(- bobber-bottom
(* (. state fish-y) target-range)))
(var target-y float
(- target-center-y (/ target-height 2.0f)))
(DrawTexture (. state popup-target)
(cast target-x int)
(cast target-y int)
WHITE)))
(GuiLabel #(Rectangle : (GuiLabel #(Rectangle :
(+ (. popup x) FISHING-POPUP-PADDING) (+ (. popup x) FISHING-POPUP-PADDING)
@@ -213,11 +269,6 @@
40.0f) 40.0f)
"X: pull! ESC: leave...") "X: pull! ESC: leave...")
;; The golden rectangle is the bobber, hanging at the bottom of the popup
(var bobber-bottom float
(- (+ (. popup y) (. popup height))
FISHING-POPUP-PADDING))
(var progress-bar-length int (- (. popup width) (* 2 FISHING-POPUP-PADDING))) (var progress-bar-length int (- (. popup width) (* 2 FISHING-POPUP-PADDING)))
(var progress-bar-bg _ (var progress-bar-bg _
#(Rectangle : #(Rectangle :
@@ -232,48 +283,7 @@
(+ (. popup y) -10 (* 3 FISHING-POPUP-PADDING)) (+ (. popup y) -10 (* 3 FISHING-POPUP-PADDING))
(* progress-bar-length (. state catch-progress)) (* progress-bar-length (. state catch-progress))
6)) 6))
(DrawRectangleRec progress-bar BLUE) (DrawRectangleRec progress-bar BLUE))
(var bobber-bg _
#(Rectangle :
(+ (. popup x)
-1.0f
(/ (- (. popup width) BOBBER-WIDTH) 2.0f))
(+ (. popup y) -1.0f (* 3.0f FISHING-POPUP-PADDING))
(+ 2.0f BOBBER-WIDTH)
(- (+ (. popup height) 2.0f)
(* 4.0f FISHING-POPUP-PADDING))))
(DrawRectangleLinesEx bobber-bg 2.0f DARKBROWN)
(var bobber-rect _
#(Rectangle :
(+ (. popup x)
(/ (- (. popup width) BOBBER-WIDTH) 2.0f))
(- bobber-bottom BOBBER-HEIGHT (. state bobber-y))
BOBBER-WIDTH
BOBBER-HEIGHT))
(DrawRectangleRec bobber-rect GOLD)
(DrawRectangleLinesEx bobber-rect 2.0f DARKBROWN)
;; Fish sprite sits beside the bobber and moves over the same range
(if (IsTextureValid (. state fish-texture))
(do
(var fish-range float (fishing-bobber-range))
(var fish-width float (cast (. state fish-texture width) float))
(var fish-height float (cast (. state fish-texture height) float))
(var fish-rect _
#(Rectangle :
(+ (. popup x)
(/ (- (. popup width) BOBBER-WIDTH) 2.0f)
BOBBER-WIDTH
FISH-GAP)
(- bobber-bottom
(* (. state fish-y) fish-range)
fish-height)
fish-width
fish-height))
(DrawTexture (. state fish-texture)
(cast (. fish-rect x) int)
(cast (. fish-rect y) int)
WHITE))))
(pub fn render-game ((state (* game-state))) void (pub fn render-game ((state (* game-state))) void
(BeginDrawing) (BeginDrawing)

View File

@@ -8,6 +8,8 @@
(pub record menu-state (pub record menu-state
((app-state (* app-state)) ((app-state (* app-state))
(bg Texture2D) (bg Texture2D)
(mus-on Texture2D)
(mus-off Texture2D)
(btn-to-game int) (btn-to-game int)
(btn-toggle-music int) (btn-toggle-music int)
(btn-exit int))) (btn-exit int)))
@@ -18,8 +20,7 @@
(define BTN-WIDTH 320.0) (define BTN-WIDTH 320.0)
(define BTN-HEIGHT 72.0) (define BTN-HEIGHT 72.0)
(define MUSIC-BTN-WIDTH 240.0) (define MUSIC-BTN-SIZE 64.0)
(define MUSIC-BTN-HEIGHT 60.0)
(define MUSIC-BTN-MARGIN 40.0) (define MUSIC-BTN-MARGIN 40.0)
(pub fn mk-menu ((app-state (* app-state))) page (pub fn mk-menu ((app-state (* app-state))) page
@@ -32,9 +33,17 @@
(var img Image (LoadImage "res/img/menu.png")) (var img Image (LoadImage "res/img/menu.png"))
(ImageResize (& img) WIN-WIDTH WIN-HEIGHT) (ImageResize (& img) WIN-WIDTH WIN-HEIGHT)
(= (. state bg) (LoadTextureFromImage img)) (= (. state bg) (LoadTextureFromImage img))
(= (. state mus-on) (LoadTexture "res/img/mus.png"))
(= (. state mus-off) (LoadTexture "res/img/mus_off.png"))
(return (page/menu state))) (return (page/menu state)))
(pub fn rm-menu ((state (* menu-state))) void (pub fn rm-menu ((state (* menu-state))) void
(if (IsTextureValid (. state bg))
(UnloadTexture (. state bg)))
(if (IsTextureValid (. state mus-on))
(UnloadTexture (. state mus-on)))
(if (IsTextureValid (. state mus-off))
(UnloadTexture (. state mus-off)))
(free state) (free state)
(return)) (return))
@@ -55,15 +64,32 @@
BTN-WIDTH BTN-WIDTH
BTN-HEIGHT) "Quit")) BTN-HEIGHT) "Quit"))
(var music-label (* const char) "Music: On") (var music-x float (- WIN-WIDTH (+ MUSIC-BTN-MARGIN MUSIC-BTN-SIZE)))
(if (! (audio-music-enabled))
(= music-label "Music: Off"))
(= (. state btn-toggle-music) (= (. state btn-toggle-music)
(GuiButton #(Rectangle : (GuiButton #(Rectangle :
(- WIN-WIDTH (+ MUSIC-BTN-MARGIN MUSIC-BTN-WIDTH)) music-x
MUSIC-BTN-MARGIN MUSIC-BTN-MARGIN
MUSIC-BTN-WIDTH MUSIC-BTN-SIZE
MUSIC-BTN-HEIGHT) music-label)) MUSIC-BTN-SIZE) ""))
(var music-icon Texture2D (. state mus-on))
(if (! (audio-music-enabled))
(= music-icon (. state mus-off)))
(if (IsTextureValid music-icon)
(DrawTexturePro music-icon
#(Rectangle :
0.0f
0.0f
(cast (. music-icon width) float)
(cast (. music-icon height) float))
#(Rectangle :
music-x
MUSIC-BTN-MARGIN
MUSIC-BTN-SIZE
MUSIC-BTN-SIZE)
#(Vector2 : 0.0f 0.0f)
0.0f
WHITE))
(EndDrawing)) (EndDrawing))

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.12.2" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="16" tileheight="16" infinite="0" nextlayerid="17" nextobjectid="2"> <map version="1.10" tiledversion="1.12.2" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="16" tileheight="16" infinite="0" nextlayerid="17" nextobjectid="8">
<tileset firstgid="1" source="basictiles.tsx"/> <tileset firstgid="1" source="basictiles.tsx"/>
<tileset firstgid="121" name="Sprite-0004" tilewidth="16" tileheight="16" tilecount="16" columns="8"> <tileset firstgid="121" name="Sprite-0004" tilewidth="16" tileheight="16" tilecount="16" columns="8">
<image source="Sprite-0004.png" width="128" height="32"/> <image source="Sprite-0004.png" width="128" height="32"/>
@@ -8,7 +8,6 @@
<image source="dead.png" width="48" height="64"/> <image source="dead.png" width="48" height="64"/>
</tileset> </tileset>
<tileset firstgid="149" source="ekko.tsx"/> <tileset firstgid="149" source="ekko.tsx"/>
<objectgroup id="16" name="fishing-spots"/>
<layer id="1" name="background" width="64" height="64"> <layer id="1" name="background" width="64" height="64">
<data encoding="csv"> <data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -34,31 +33,31 @@
0,0,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,0,0,0,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,11,0,0,0,0,0,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,11,11,11,0,0,0,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -825,6 +824,13 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data> </data>
</layer> </layer>
<objectgroup id="16" name="fishing-spots">
<object id="2" x="182" y="512.667" width="41.3333" height="30"/>
<object id="3" x="249.333" y="342" width="48" height="28"/>
<object id="4" x="479.333" y="649.333" width="49.3333" height="40"/>
<object id="5" x="636.667" y="419.333" width="44" height="37.3333"/>
<object id="7" x="490.667" y="385.333" width="52" height="38.6667"/>
</objectgroup>
<objectgroup color="#ffffff" id="15" name="objects"> <objectgroup color="#ffffff" id="15" name="objects">
<object id="1" name="player" gid="149" x="497.75" y="350" width="32" height="32"/> <object id="1" name="player" gid="149" x="497.75" y="350" width="32" height="32"/>
</objectgroup> </objectgroup>

View File

@@ -9,6 +9,7 @@
html, body { html, body {
margin: 0; margin: 0;
height: 100%; height: 100%;
overflow: hidden;
background: #05070d; background: #05070d;
color: #7c8798; color: #7c8798;
font: 14px/1.5 system-ui, sans-serif; font: 14px/1.5 system-ui, sans-serif;
@@ -58,6 +59,19 @@
}; };
unlockEvents.forEach((type) => addEventListener(type, unlockAudio, true)); unlockEvents.forEach((type) => addEventListener(type, unlockAudio, true));
// Arrow keys and Space also scroll the page by default. Cancel that
// while the game canvas has focus, but keep modified keys for browser
// shortcuts.
const gameCanvas = document.getElementById('canvas');
const scrollKeys = new Set([
'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Space',
]);
addEventListener('keydown', (event) => {
if (event.ctrlKey || event.metaKey || event.altKey) return;
if (event.target !== gameCanvas && document.activeElement !== gameCanvas) return;
if (scrollKeys.has(event.code)) event.preventDefault();
}, { capture: true });
var Module = { var Module = {
canvas: document.getElementById('canvas'), canvas: document.getElementById('canvas'),
print: console.log.bind(console), print: console.log.bind(console),