diff doc/art.md @ 36:a464bd43b76c 1.0.0

clean documentation rewrite
author ark
date 2026-10-21 22:34 +0200
parents 85d23328a215
children
line wrap: on
line diff
--- a/doc/art.md	Tue Oct 20 19:54:56 2026 +0200
+++ b/doc/art.md	Wed Oct 21 22:34:43 2026 +0200
@@ -1,187 +1,186 @@
-art assets
-----------
+Art and sound
+-------------
 
-b0-b3: boss monsters for each map level
-c0-c3: coin variants
-hpb: hp bar for bosses
-hpm: hp bar for monsters
-m0-m4: monster progression
-map0-map3: map level art. maps are to be scaled approx 400%
-map*mask: map level definitions, blue: monster entrance, red: path centre line, green: exit
-p0-p3: projectiles for defense towers
-t0-t3: defense towers
-t*p: defense towers upgrade progression
-art_sources/: the scans the drawings were cut from
-art_sources/source_sheet.jpg: the original drawing sheet with all sprites, maps, damage
-values, monster and boss coins, and starting coins per map. map numbers on the
-sheet start at 1 (M1-M4 are map0-map3)
-art_sources/source_sheet_2.jpg: the same sheet with the sprite outlines inked in black, and
-    monster hp and tower costs added. m*, b*, t*, t*p, p* and the hp bars are
-    cut from it by tools/cut_sheet.py
+All drawings and voice recordings come from the artist. Files in art/
+stay as supplied, apart from the files the cutting scripts write there.
+The build writes processed copies to www/ (architecture.md). Drawing tips
+for new items: dark outline, white or coloured inside, on white paper with
+space around each item.
+
+
+Scans
+-----
 
-splash.png: splash screen including play button
-splash_play.png: play button from splash screen
-map_won.png: map won screen
-map_won_button.png: arrow button from map won screen
-game_lost.png: map/game lost
-game_lost_button.png: button from game_lost
-game_won.png: game won screen, cut from art_sources/game_won.jpg
-game_won_button.png: restart button from game_won, cut from the same scan
-sound_on.png, sound_off.png: sound setting
-speed_x1.png, speed_x2.png, speed_x4.png: speed selection buttons
-play_button.png, pause_button.png: play and pause
-monster_icon.png: monster/wave count icon
-digits.png: sheet with all digits and a slash, in multiple variants.
-    tools/cut_digits.py cuts it into art/digits/
-monster_death.png: monster death puff
-boss_death.png: boss death puff
-upgrade_button.png, sell_button.png: upgrade and sell buttons
-tower_popup.png: bubble for tower upgrade/sell popup
-next_wave.png: start next wave early button
-shop_bubble.png: tower shop items bubble
-shop_bubble_dark.png, shop_bubble_dark2.png: selected tower shop item bubble in
-    2 variants
-heart.png: heart counter icon
-coin_icon.png: coin counter icon
-freeze.png: t2 freeze splash, drawn where p2 lands
-wobbly_logo.png: logo on the splash screen, left of the play button, links to
-    a web page
-help_splash.png: question mark on the splash screen, right of the play
-    button, opens the help popup
-help_button.png: help button in the top bar, opens the help popup
+The directory art/art_sources/ holds the scans the drawings were cut from.
 
-notes:
-    - writing numbers should use digit variants. scale digits to same size in
-      preprocessing.
-    - start next wave early omit bonus coins count
+- source_sheet.jpg: the original sheet with all sprites, maps, and the
+  first numbers for damage, coins and starting coins (history.md). Map
+  numbers on the sheet start at 1: M1 to M4 are map0 to map3
+- source_sheet_2.jpg: the same sheet with the sprite outlines inked in
+  black, and monster hit points and tower costs added. The script
+  tools/cut_sheet.py cuts the sprites from it
+- game_won.jpg, help_info.jpg, icons.jpg, icons_and_numbers.jpg,
+  more_buttons.jpg, splash.jpg, upgrade_popup.jpg: scans of the screens,
+  icons and buttons
+
+On both sheets the towers t0 and t1 are swapped: the tower row runs t1,
+t0, t2, t3, and the projectile row p1, p0, p2, p3.
 
 
+Sprites
+-------
 
-files in art/ stay as supplied, apart from the sprites cut from a sheet and
-the sounds cut from the recordings. the build (see architecture.md) writes
-processed copies to www/assets/.
-
-attn: the source_sheet_* files have the towers t0 and t1 swapped. 
+| File       | What                                   | Source |
+|------------|----------------------------------------|--------|
+| m0-m4      | Regular monsters                       | cut_sheet.py |
+| b0-b3      | Bosses, one per map                    | cut_sheet.py |
+| t0-t3      | Towers, level 1                        | cut_sheet.py |
+| t0p-t3p    | Towers, levels 2 to 5 side by side     | cut_sheet.py |
+| p0-p3      | Projectiles of t0 to t3                | cut_sheet.py |
+| hpm, hpb   | HP bars of monsters and bosses         | cut_sheet.py |
+| c0-c3      | Coins                                  | Cut by hand from the first sheet |
+| freeze     | t2 freeze splash, drawn where p2 lands | Supplied |
+| monster_death, boss_death | Death puffs             | Supplied |
 
-sound source files in art/sound_sources, all phone voice recordings, named
-after their sound event (sound.md). tools/cut_sounds.py cuts them into
-art/sounds/; a recording with variants gives one sound per variant:
-    t0_attack: t0 attack, 4 variants
-    t1_shot: t1 tower shot, 6 variants
-    t2_shot: t2 tower shot, 4 variants
-    t3_shot: t3 shot, 7 variants
-    monster_enter: monster enters map, 3 variants
-    monster_exit: monster reaches map exit
-    monster_die: monster death, 4 variants
-    boss_enter: boss enters map
-    boss_exit: boss reaches map exit
-    boss_die: boss death
-    map_won: level win
-    map_lost: game lost
-    intro: splash screen music, starts with a burp that the script cuts off
+- Sprites cut by cut_sheet.py keep the sheet's scale: black outlines,
+  transparent outside, white paper inside, drawn colour kept (bosses, HP
+  bars)
+- The t*p strips are cut from the same sheet as level 1, so the sizes
+  follow on. The build splits them and fills any inside left transparent
+  with white
+- Level 5 of t3 is a different design from levels 1 to 4: a square with a
+  barrel, not a triangle
+- Monsters and bosses face the viewer and are never rotated or mirrored
+
+
+Maps and masks
+--------------
+
+The files map0 to map3 are the map scans, with paper edges. Each map*mask
+is the mask of the same map and lines up with it pixel for pixel.
+
+Masks have hard edges. Every pixel is fully transparent or opaque pure
+red, blue or green; the build stops on any other pixel.
 
-state of the files
-------------------
+- Red: the centre line the monsters walk, about 11 pixels wide, not the
+  whole road. The road's half width is set per map in the config
+- Blue: monster entrances
+- Green: exits
+
+Where the route extraction gets a map wrong, the mask is redrawn.
+
+
+Screens, buttons and icons
+--------------------------
 
-- t0-t3, m0-m4, b0-b3, p0-p3, hpm, hpb: cut from source_sheet_2.jpg at the
-  sheet's scale. black outlines, transparent outside. inside, the paper is
-  white and drawn colour is kept (bosses, hp bars)
-- c0-c3: cut out by hand from the first sheet, transparent outside
-- towers have 5 levels. t0-t3 are level 1
-- t*p: outlines of tower levels 2-5 side by side, cut from the same sheet as
-  level 1, so the sizes follow on. the build splits them and fills any
-  inside left transparent white
-- on the sheet, the tower row runs t1, t0, t2, t3 and the projectile row
-  p1, p0, p2, p3
-- t3 level 5 is a different design from levels 1-4 (square with a barrel
-  instead of a triangle)
-- maps: scans with paper edges. map and mask of the same number line up pixel
-  for pixel
-- masks: hard edges, no anti-aliasing. every pixel is fully transparent or
-  opaque pure red, blue or green; the build stops on any other pixel. red
-  marks the centre line the monsters walk, about 11 pixels wide, not the
-  whole road. map1 has branches, map2 has two entrances and loops
-- icons, buttons and screens: transparent outside, apart from splash.png,
-  which is opaque with white paper. the separate screen buttons are exact
-  crops of the buttons in their screen drawings
-- art/digits/: every drawing on digits.png is one variant, named after the
-  character and a number (0_1, 0_2, ..., slash_1). all are scaled to the same
-  height, the median of the drawings, and the paper is transparent. the
+| File                     | Use |
+|--------------------------|-----|
+| splash                   | Splash screen with title, byline and play button; opaque with white paper |
+| splash_play              | Play button of the splash screen |
+| wobbly_logo              | Logo left of the play button, opens the game's web page |
+| help_splash              | Question mark right of the play button, opens the help popup |
+| help_info                | Help popup |
+| map_won, map_won_button  | Map won screen and its next button |
+| game_lost, game_lost_button | Game lost screen and its button |
+| game_won, game_won_button | Game won screen and its restart button, cut from game_won.jpg |
+| coin_icon, heart, monster_icon | Top bar counters |
+| help_button              | Help button in the top bar |
+| play_button, pause_button | Pause button: pause while running, play while paused |
+| speed_x1, speed_x2, speed_x4 | Speed button |
+| sound_on, sound_off      | Sound button; sound_on also on the splash screen's sound button |
+| next_wave                | Early start button, the countdown drawn on its right part |
+| shop_bubble              | Shop item |
+| shop_bubble_dark, shop_bubble_dark2 | Chosen shop item, in turn |
+| tower_popup              | Bubble of the tower menu |
+| upgrade_button, sell_button | Buttons in the tower menu |
+| digits                   | Sheet of digits and a slash, several variants each |
+
+- All are transparent outside, apart from splash
+- The separate screen buttons are exact crops of the buttons in their
+  screen drawings
+- The script tools/cut_digits.py cuts digits.png into art/digits/: every
+  drawing is one variant, named after the character and a number (0_1,
+  0_2, ..., slash_1), scaled to the median height, paper transparent. The
   10, 11 and 12 on the sheet give single digits
 
 
-drawing direction
+Drawing direction
 -----------------
 
-turning towers and projectiles are rotated to face their target. each sprite
-records which way it points as drawn, so the game can correct for it. angles
-as on screen: 0 is right, -90 is up.
-
-the drawings are not consistent, even between levels of the same tower. the
-angle of each sprite is set by hand in [art.angle] in config/game.toml. the
-build draws temp/preview/towers.png with every turning tower turned to face
-up, so a wrong angle shows as a barrel off the vertical guide line. the table
-gives the rough direction; config/game.toml has the exact values.
+Turning towers and projectiles are rotated to face their target. The
+drawings are not consistent, even between levels of the same tower, so
+each sprite's direction as drawn is set by hand in [art.angle]: 0 is right,
+-90 is up. Sprites not listed there do not turn: t0, and p2, which is
+round. The spike p0 is listed because each t0 spike is turned to point
+outwards.
 
-| sprite        | points to | angle |
-|---------------|-----------|-------|
-| t0, all levels | does not turn | - |
-| t1, all levels | right    | -6 to 0 |
-| t2, all levels | up       | -95 to -89 |
-| t3 levels 1-2 | up-right  | -48 to -43 |
-| t3 levels 3-4 | right, a little up | -15 |
-| t3 level 5    | up        | -88   |
-| p0            | up        | -90   |
-| p1            | right (nearly square, a little lopsided) | 0 |
-| p2            | any (round) | -   |
-| p3            | up-right  | -45   |
+The whole tower sprite turns, base included. It turns around the centre of
+the trimmed image, or around the point set in [art.pivot]; the turning
+towers turn around the middle of their body.
 
-the tower sheet does not show the projectiles.
-
-the whole tower sprite turns, base included; the drawings do not separate a
-base from a turret. rotation is around the centre of the trimmed image unless
-the config sets another point.
-
-monsters and bosses face the viewer and are not rotated or mirrored.
+The preview temp/preview/towers.png, written by the build, shows every
+turning tower turned to face up, with its pivot. A wrong angle shows as a
+barrel off the vertical guide line.
 
 
-hp bars
+HP bars
 -------
 
-the bar is drawn cut to the share of hp left. the empty part is drawn as a
-darkened copy of the bar (suggestion). hpm sits above every monster, hpb above
-the boss.
-
-while t2 slows a monster, its bar is drawn in blue. the build makes the blue
-bars from hpm and hpb by changing the colour of the green inside to blue; the
-outline stays as drawn. the empty part of a blue bar is a darkened copy of the
-blue bar.
+The bar is drawn cut to the share of hit points left, over a darkened copy
+for the empty part. The bar hpm sits above every monster, hpb above the
+boss. While t2 slows a monster its bar is blue: the build makes blue
+copies of both bars by changing the colour of the green inside; the
+outline stays as drawn.
 
 
-art still needed
-----------------
-
-every icon and screen in the list above is in the game. not drawn yet:
+Sound
+-----
 
-- cancel or close. the game has no such button so far; a second tap on the
-  chosen shop item cancels it
-- plus sign. the early start button no longer shows the bonus, so it is not
-  needed for now
+The voice recordings in art/sound_sources/ were made on a phone and are
+named after their event. The script tools/cut_sounds.py turns them into
+game sounds in art/sounds/; a recording with variants is split into
+NAME_1, NAME_2 and so on, and the game picks one at random. The output is
+mono MP3, which desktop and mobile browsers play. The intro recording
+loses its first 3 s, which hold a burp, and gets a short pause at its end
+for the loop.
+
+The event name is the name of its recordings and its entry in
+[sound.event], which sets its volume, an optional minimum time between two
+plays, and the placeholder beep. Events without a recording play the beep.
 
-optional:
+| Event                | Name              | Sound |
+|----------------------|-------------------|-------|
+| t0 attack            | t0_attack         | Recorded, 4 variants |
+| t1 shot              | t1_shot           | Recorded, 6 variants |
+| t2 shot              | t2_shot           | Recorded, 4 variants |
+| t3 shot              | t3_shot           | Recorded, 7 variants |
+| Monster enters map   | monster_enter     | Recorded, 3 variants |
+| Monster dies         | monster_die       | Recorded, 4 variants |
+| Monster reaches exit | monster_exit      | Recorded |
+| Boss enters map      | boss_enter        | Recorded |
+| Boss reaches exit    | boss_exit         | Recorded |
+| Boss dies            | boss_die          | Recorded |
+| Map won              | map_won           | Recorded |
+| Map lost             | map_lost          | Recorded |
+| Splash screen music  | intro             | Recorded, loops |
+| Monster hit          | monster_hit       | Beep |
+| Coins arrive         | coins_arrive      | Beep |
+| Wave starts          | wave_start        | Beep |
+| Early start bonus    | early_bonus       | Beep |
+| Tower built          | tower_built       | Beep |
+| Tower upgraded       | tower_upgraded    | Beep |
+| Tower sold           | tower_sold        | Beep |
+| Placement refused    | placement_refused | Beep |
+| Button tap           | button_tap        | Beep |
 
-- t0 spike burst, if p0 alone does not read well as an attack
-- hit puffs
-- a mark for a refused placement. the game draws a red cross for now
-
-drawing tips for these: dark outline, white or coloured inside, on white
-paper with space around each item, so the build can cut them out the same way
-as the existing sprites.
+The beeps are accepted as they are.
 
 
-possible addition
------------------
+Optional art
+------------
 
-if decorated areas of a map, such as the lava pools on map3, should be off
-limits for towers, a fourth mask colour (for example black) could mark them.
-not decided.
+Not needed for the game, possible additions:
+
+- A t0 spike burst, if p0 alone does not read well as an attack
+- Hit puffs
+- A mark for a refused placement, in place of the red cross