# HG changeset patch
# User ark
# Date 1792509580 -7200
# Node ID 75deda08db9044b56e3f961aef33a3cbe7ee2b41
# Parent 28e1fc486be541e014540a8e78945e783e83a4a9
game debug functions separated into own file; release build option, distribution script
diff -r 28e1fc486be5 -r 75deda08db90 config/game.toml
--- a/config/game.toml Tue Oct 20 16:06:50 2026 +0200
+++ b/config/game.toml Tue Oct 20 17:19:40 2026 +0200
@@ -300,7 +300,6 @@
show_grid = false
show_ranges = false
show_hit_areas = false
-extra_speeds = [] # added to the game speeds, for example [8]
show_stats = false # frame time and entity counts
seed = 0 # random seed, 0 picks a new one each run
diff -r 28e1fc486be5 -r 75deda08db90 doc/architecture.md
--- a/doc/architecture.md Tue Oct 20 16:06:50 2026 +0200
+++ b/doc/architecture.md Tue Oct 20 17:19:40 2026 +0200
@@ -31,7 +31,7 @@
index.html copied from game/, as are style.css and js/
assets/ processed images
data/ maps.js, sounds.js, config.js
- dist/ zip archives for distribution (ignored)
+ dist/ tarballs for distribution (ignored)
temp/ scratch files, build previews (ignored)
generated files carry a header line saying so and naming the script that made
@@ -44,8 +44,8 @@
- desktop: open www/index.html directly from disk, or serve the directory
with any static web server
- tablet: tablets cannot easily open local html files, so the game is served
- over http, from a computer on the home network or from a web host. the zip
- in dist/ is meant for that
+ over http, from a computer on the home network or from a web host. the
+ tarball in dist/ is meant for that
- an optional later step makes it installable to the home screen (web app
manifest, offline cache). that requires https
@@ -129,14 +129,25 @@
with its pivot and footprint
9. game files: copy the files in game/ to www/. a file is copied when its
time or size differs from the copy. files no longer in game/ are removed
- from www/, apart from www/assets/ and www/data/
+ from www/, apart from www/assets/ and www/data/. a release build writes
+ www/js/debug.js empty
a watch mode (`tools/build.py --watch`) reruns the build when a file in
config/, art/, art/sounds/ or game/ changes. tuning then means: edit the toml,
save, reload the browser. the same goes for changes to the game code: they
show in www/ only after the build has copied them.
-`tools/publish.py` writes a zip of www/ into dist/, with debug switches off.
+`tools/build.py --release` leaves the debug code out: it writes
+www/js/debug.js empty and leaves [debug] out of config.js. the game then
+runs as with every debug switch off.
+
+`tools/make_dist.sh` runs a release build and packs www/ into
+dist/minor_monsters_VERSION.tar.gz, which unpacks into a directory
+minor_monsters. the version comes from `tools/get_version.sh -f`: the
+latest tag, with a timestamp appended when the working directory is not
+clean or not at the tagged revision. `--debug` builds with the debug code
+in place of a release build. www/ keeps the build the script made, so a
+plain build afterwards brings the debug code back.
balance tools
@@ -176,9 +187,10 @@
it loads www/data/config.js, www/data/maps.js and the logic files util.js,
assets.js, map.js, monster.js, tower.js, projectile.js, wave.js and
game.js, as the browser would, with window set to the global object.
-render.js, ui.js, input.js and main.js are left out. MM.audio is the only
-stub; assets.js loads unchanged, since sprite sizes come from the config
-and images are only loaded by main.js. the debug switches are forced off.
+render.js, ui.js, input.js, debug.js and main.js are left out, so the
+debug switches have no effect. MM.audio is the only stub; assets.js loads
+unchanged, since sprite sizes come from the config and images are only
+loaded by main.js.
the game advances in steps of 1/60 s, as in the browser; game speed plays
no part. each run has its own seed, passed to the game. the players build,
@@ -257,8 +269,13 @@
button starts it, and a lost map returns to it
- no heart loss
- show routes, placement grid, tower ranges, hit areas
-- higher game speeds
- on-screen frame time and entity counts
+- a fixed random seed
+
+js/debug.js holds the code for all of them. it replaces functions of the
+game and the top bar drawing, and render.js calls it to draw over the map
+image and over the monsters. main.js takes the start map, wave and seed
+from it. without it, as in a release build, nothing of this is left.
there is no in-game config editor: values are changed in the toml file.
@@ -284,6 +301,7 @@
js/render.js drawing
js/ui.js top bar, shop, tower menu, screens
js/input.js pointer events
+ js/debug.js debug switches, empty in a release build
js/main.js start-up and main loop
game loop:
diff -r 28e1fc486be5 -r 75deda08db90 doc/roadmap.md
--- a/doc/roadmap.md Tue Oct 20 16:06:50 2026 +0200
+++ b/doc/roadmap.md Tue Oct 20 17:19:40 2026 +0200
@@ -40,7 +40,7 @@
- icons, screens and digits as the drawings arrive (art.md)
- voice recordings as they arrive (sound.md)
10. publishing
- - publish script, dist/ zip of www/, hosting for tablet play
+ - tools/make_dist.sh, dist/ tarball of www/, hosting for tablet play
11. help page
- a hint page made from game graphics, no text where a picture will do
- the tower ranges side by side
@@ -238,7 +238,7 @@
counters, right-aligned as before. the buttons run help, pause, speed,
sound and early start from the right. pause shows pause_button
while the game runs and play_button while it is paused. speed shows the
- drawing of the current speed; debug speeds show their number. the early
+ drawing of the current speed. the early
start button shows the countdown on next_wave, without the bonus. the top
bar needs about 670 css pixels of width; narrower screens are not handled
- numbers: the digit variant of each place depends on the digit and its
@@ -251,7 +251,7 @@
to full size over the first half of their time and fade out over the
second half. they are dropped when the map ends
- debug switches: all from architecture.md. start_coins -1 means the map's own value, seed 0 a new seed per
- run
+ run. the debug tower ranges are drawn under the towers
- sound: the play button on the splash screen starts the sound; taps
before it leave sound off. later pointer and touch events resume audio
if the browser has suspended it. switching sound off mutes the output at
diff -r 28e1fc486be5 -r 75deda08db90 game/index.html
--- a/game/index.html Tue Oct 20 16:06:50 2026 +0200
+++ b/game/index.html Tue Oct 20 17:19:40 2026 +0200
@@ -25,6 +25,7 @@
+