From 58a95dcf8e51b08788fd8c8f2a47563426674b31 Mon Sep 17 00:00:00 2001 From: He4eT Date: Sun, 22 Jun 2025 15:59:39 +0200 Subject: [PATCH 1/7] game: replace notes with numbers --- game.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game.js b/game.js index 904117d..9b25972 100644 --- a/game.js +++ b/game.js @@ -637,9 +637,9 @@ function gameover() { if (player.score > arena.highscore) { pmem(0, player.score) - sfx(0, 'C-5', 30, 1, 6) + sfx(0, 38, 30, 1, 6) } else { - sfx(0, 'F-2', 30, 1, 5) + sfx(0, 17, 30, 1, 5) } effects = [ From f1c18c27ac6a0c1220e8453cd09d0a80ed5ee666 Mon Sep 17 00:00:00 2001 From: He4eT Date: Sun, 22 Jun 2025 16:07:36 +0200 Subject: [PATCH 2/7] cover: store as the code only --- Makefile | 12 ++++-- cover.png | Bin 316 -> 0 bytes game.js | 120 +++++++++++++++++++++++++++--------------------------- 3 files changed, 68 insertions(+), 64 deletions(-) delete mode 100644 cover.png diff --git a/Makefile b/Makefile index ab5d4cb..c2d1217 100644 --- a/Makefile +++ b/Makefile @@ -25,13 +25,17 @@ export_png: ${tic_cli} \ 'load ${game_src} & save ${build_dir}/${game_name}.png & exit' -import_cover: - ${tic_cli} \ - 'load ${game_src} & import screen ${cover_src} & exit' - release: @make cleanup @make export_tic @make export_png +export_cover: + ${tic_cli} \ + 'load ${game_src} & export screen ${cover_src} & exit' + +import_cover: + ${tic_cli} \ + 'load ${game_src} & import screen ${cover_src} & exit' + # vim: set ts=4 sw=4 autoindent noexpandtab: diff --git a/cover.png b/cover.png deleted file mode 100644 index 24e69b787b3a7588e4de48bc3e7773e905e1ae29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 316 zcmV-C0mJ@@P)R}Ywrf?53=hOP{(Bx9txm~s ziwuvA7N_!rVVV+#!$~syA}zWTW-?8(9%emElqh;4isyj;?qN@b9{}!!MlxK}Qc6CD zFYP_7?jtB+yu Date: Mon, 23 Jun 2025 17:04:51 +0200 Subject: [PATCH 3/7] gitignore: add node_modules --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8b6614a..41d654c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .local/ build/ +node_modules/ From fd3959028491fbce90fba855d5b5e1f71156fbdf Mon Sep 17 00:00:00 2001 From: He4eT Date: Mon, 23 Jun 2025 17:12:14 +0200 Subject: [PATCH 4/7] game: numbers for cls --- game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.js b/game.js index 16dba49..0f838b3 100644 --- a/game.js +++ b/game.js @@ -482,7 +482,7 @@ let effects = [] const effectRenderers = { flash: ({ frames }) => { - const color = frames.shift() + const color = parseInt(frames.shift()) cls(color) }, laser: ({ from, to, frames }) => { From 4a47806c80ba7d4b6b9c961b54d57160a82c29c1 Mon Sep 17 00:00:00 2001 From: He4eT Date: Mon, 23 Jun 2025 18:33:38 +0200 Subject: [PATCH 5/7] game: extract FONT_SIZE --- game.js | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/game.js b/game.js index 0f838b3..ff87955 100644 --- a/game.js +++ b/game.js @@ -11,6 +11,7 @@ const DOT_DASH_THRESHOLD = 200 const DOT_DASH_IDLE_TIMEOUT = 500 +const FONT_SIZE = 1 const HINT_DISTANCE = 30 /* Game Screens */ @@ -437,40 +438,50 @@ function drawEnemies() { } function drawEnemyLetters() { + const backgroundColor = 2 + const borderColor = 5 + const letterWidth = 8 * FONT_SIZE + const letterHeight = 7 * FONT_SIZE + const boxWidth = letterWidth + 2 * FONT_SIZE + const boxHeight = letterHeight + 4 * FONT_SIZE + const offset = 9 + 2 * SPRITE_RADIUS * FONT_SIZE + enemies.forEach((enemy) => { - const bgColor = 2 - const borderColor = 5 const enemyPosition = enemy.positions[0] const d = getDirection(player.position, enemyPosition) - const letterPos = { - x: enemyPosition.x + d.x * 15, - y: enemyPosition.y + d.y * 15, + const letterPosition = { + x: enemyPosition.x + d.x * offset, + y: enemyPosition.y + d.y * offset, } - const screenPos = worldToScreen(letterPos) + const screenPosition = worldToScreen(letterPosition) + const boxX = screenPosition.x - boxWidth / 2 + FONT_SIZE + const boxY = screenPosition.y - boxHeight / 2 + FONT_SIZE + const letterX = screenPosition.x - letterWidth / 2 + FONT_SIZE + const letterY = screenPosition.y - letterHeight / 2 + FONT_SIZE - rect(screenPos.x - 4, screenPos.y - 5, 10, 11, bgColor) - rectb(screenPos.x - 4, screenPos.y - 5, 10, 11, borderColor) - font(enemy.letter, screenPos.x - 3, screenPos.y - 3, 0, 8, 8, true) + rect(boxX, boxY, boxWidth, boxHeight, backgroundColor) + rectb(boxX, boxY, boxWidth, boxHeight, borderColor) + font(enemy.letter, letterX, letterY, 0, 8, 8, true, FONT_SIZE) if (getDistance(player.position, enemy.positions[0]) < HINT_DISTANCE) { const code = letterToMorse[enemy.letter].split('') const hintWidth = MORSE_GAP + morseWidth(code) const hintPosition = { - x: screenPos.x - 4, - y: screenPos.y + 8, + x: boxX, + y: boxY + boxHeight + 2, } rect( hintPosition.x, hintPosition.y - 1, - Math.max(10, hintWidth), + Math.max(boxWidth, hintWidth), MORSE_GAP + 2, borderColor, ) - drawMorse(code, hintPosition.x, hintPosition.y, 2) + drawMorse(code, hintPosition.x, hintPosition.y, backgroundColor) } }) } From 7862061d9337f98d9a127dd04df55220b3080f23 Mon Sep 17 00:00:00 2001 From: He4eT Date: Tue, 24 Jun 2025 15:20:37 +0200 Subject: [PATCH 6/7] game: make the start more friendly --- game.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/game.js b/game.js index ff87955..f776485 100644 --- a/game.js +++ b/game.js @@ -9,7 +9,7 @@ // version: 1.0 const DOT_DASH_THRESHOLD = 200 -const DOT_DASH_IDLE_TIMEOUT = 500 +const DOT_DASH_IDLE_TIMEOUT = 450 const FONT_SIZE = 1 const HINT_DISTANCE = 30 @@ -356,12 +356,20 @@ function spawnEnemies() { const enemyCount = 1 + Math.floor(arena.wave / 2) const getType = (wave) => { - if (wave <= 2) return 'point' - const availableTypes = Object.keys(enemyBlueprints) + + if (wave <= 2) return availableTypes[0] + if (wave <= 6) return availableTypes[wave - 2] + return availableTypes[rnd(0, availableTypes.length - 1)] } + const getSpeed = (type, wave) => { + if (wave <= 6) return 0.3 + + return enemyBlueprints[type].maxSpeed * Math.random() + } + const getSpawnPosition = (type) => { const minDistance = enemyBlueprints[type].spawnDistance const b = 4 * SPRITE_RADIUS @@ -380,7 +388,7 @@ function spawnEnemies() { const type = getType(arena.wave) return { type, - speed: enemyBlueprints[type].maxSpeed * Math.random(), + speed: getSpeed(type, arena.wave), value: enemyBlueprints[type].value, letter: alphabet[rnd(0, alphabet.length - 1)], positions: [getSpawnPosition(type), getSpawnPosition(type)], From 9c17884340058b7a72bafa2221ccd6df04c2c9e1 Mon Sep 17 00:00:00 2001 From: He4eT Date: Tue, 24 Jun 2025 15:22:06 +0200 Subject: [PATCH 7/7] game: update version --- game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.js b/game.js index f776485..69072a7 100644 --- a/game.js +++ b/game.js @@ -6,7 +6,7 @@ // input: gamepad // saveid: DotDashPit // script: js -// version: 1.0 +// version: 1.1.0 const DOT_DASH_THRESHOLD = 200 const DOT_DASH_IDLE_TIMEOUT = 450