wobblyhead hg > minor_monsters
comparison doc/architecture.md @ 11:a77857594150
adjusted tower building, added preview dragging
| author | ark |
|---|---|
| date | 2026-10-19 17:56 +0200 |
| parents | 22b604680c5a |
| children | 8df95050fc8b |
comparison
equal
deleted
inserted
replaced
| 10:22b604680c5a | 11:a77857594150 |
|---|---|
| 77 event sent to the canvas counts as a tap at that position in css pixels. | 77 event sent to the canvas counts as a tap at that position in css pixels. |
| 78 this taps the play button on the splash screen at 1024 x 768: | 78 this taps the play button on the splash screen at 1024 x 768: |
| 79 | 79 |
| 80 ff_screenshot -w 1024,768 -s 2 -S 3 -J 'document.getElementById("game") | 80 ff_screenshot -w 1024,768 -s 2 -S 3 -J 'document.getElementById("game") |
| 81 .dispatchEvent(new PointerEvent("pointerdown", | 81 .dispatchEvent(new PointerEvent("pointerdown", |
| 82 {clientX: 512, clientY: 444, bubbles: true}))' \ | 82 {clientX: 497, clientY: 560, bubbles: true}))' \ |
| 83 file://$PWD/game/index.html temp/play.png | 83 file://$PWD/game/index.html temp/play.png |
| 84 | 84 |
| 85 `ff_screenshot -h` lists the other options. | 85 `ff_screenshot -h` lists the other options. |
| 86 | 86 |
| 87 | 87 |
| 250 | 250 |
| 251 - pointer events cover mouse and touch alike | 251 - pointer events cover mouse and touch alike |
| 252 - nothing relies on hover; selection and confirmation are by tap. with a | 252 - nothing relies on hover; selection and confirmation are by tap. with a |
| 253 mouse, hover enlarges the screen buttons and shows the pointer cursor over | 253 mouse, hover enlarges the screen buttons and shows the pointer cursor over |
| 254 any button | 254 any button |
| 255 - buttons and tower selection act when the pointer goes down. placing | |
| 256 follows the pointer until it is let go, and building happens then | |
| 255 - the page blocks browser zoom and scroll gestures on the canvas | 257 - the page blocks browser zoom and scroll gestures on the canvas |
| 256 | 258 |
| 257 placement: | 259 placement: |
| 258 | 260 |
| 259 - the build's placement grid marks every cell where a tower may stand | 261 - the build's placement grid marks every cell where a tower may stand |
| 260 - on a tap, the game searches outward from the tap for the nearest legal cell | 262 - while the pointer is down, the game searches outward from it for the |
| 261 that keeps the minimum distance to other towers, within the snap radius | 263 nearest legal cell that keeps the minimum distance to other towers, within |
| 264 the snap radius. where there is none, the preview stays where it was | |
| 262 - t0 checks once, at placement, which of its four sides face the path, and | 265 - t0 checks once, at placement, which of its four sides face the path, and |
| 263 only draws spikes on those | 266 only draws spikes on those |
| 264 | 267 |
| 265 persistence: | 268 persistence: |
| 266 | 269 |
