Compare commits

...

7 commits

Author SHA1 Message Date
9c17884340 game: update version 2025-06-24 15:22:06 +02:00
7862061d93 game: make the start more friendly 2025-06-24 15:20:37 +02:00
4a47806c80 game: extract FONT_SIZE 2025-06-23 18:33:38 +02:00
fd39590284 game: numbers for cls 2025-06-23 17:12:14 +02:00
7505498238 gitignore: add node_modules 2025-06-23 17:04:51 +02:00
f1c18c27ac cover: store as the code only 2025-06-22 16:07:36 +02:00
58a95dcf8e game: replace notes with numbers 2025-06-22 15:59:39 +02:00
4 changed files with 109 additions and 85 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
.local/
build/
node_modules/

View file

@ -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:

BIN
cover.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

181
game.js
View file

@ -6,11 +6,12 @@
// input: gamepad
// saveid: DotDashPit
// script: js
// version: 1.0
// version: 1.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
/* Game Screens */
@ -355,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
@ -379,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)],
@ -437,40 +446,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)
}
})
}
@ -482,7 +501,7 @@ let effects = []
const effectRenderers = {
flash: ({ frames }) => {
const color = frames.shift()
const color = parseInt(frames.shift())
cls(color)
},
laser: ({ from, to, frames }) => {
@ -637,9 +656,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 = [
@ -900,32 +919,32 @@ const BTN_Y = 7
// 007:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 008:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 009:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 010:111111118888888888888881111188888111118888811111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888811111888881111188888111111111
// 011:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111888882111188888211111111
// 012:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111888882111188888211111111
// 013:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111888882111188888211111111
// 014:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111888882111188888211111111
// 015:111111111222222222222222111112222211111222221111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222221111122222111112222211111111
// 010:111111118888888888888881111188888111118888811111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888881111188888111118888811111111
// 011:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888211118888821111111
// 012:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888211118888821111111
// 013:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888211118888821111111
// 014:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888211118888821111111
// 015:111111111222222222222222111112222211111222221111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111222222222222222111112222211111222221111111
// 016:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 017:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 018:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 019:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 020:111111118888888888888881111188888888888888811111888888888888888111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888881111188888888888888811111888888888888888111111111
// 021:111111118888888888888882111188888888888888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888888888888821111888888888888888211111111
// 022:111111118888888888888882111188888888888888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888888888888821111888888888888888211111111
// 023:111111118888888888888882111188888888888888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888888888888821111888888888888888211111111
// 024:111111118888888888888882111188888888888888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888888888888821111888888888888888211111111
// 025:111111111222222222222222111112222222222222221111122222222222222211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111222222222222222111112222222222222221111122222222222222211111111
// 020:111111118888888888888881111188888888888888811111888888888888888111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888111118888888888888881111188888888888888811111111
// 021:111111118888888888888882111188888888888888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211118888888888888882111188888888888888821111111
// 022:111111118888888888888882111188888888888888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211118888888888888882111188888888888888821111111
// 023:111111118888888888888882111188888888888888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211118888888888888882111188888888888888821111111
// 024:111111118888888888888882111188888888888888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211118888888888888882111188888888888888821111111
// 025:111111111222222222222222111112222222222222221111122222222222222211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222211111222222222222222111112222222222222221111111
// 026:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 027:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 028:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 029:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 030:111111118888888888888881111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888111111111
// 031:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211111111
// 032:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211111111
// 033:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211111111
// 034:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211111111
// 035:111111111222222222222222111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222211111111
// 030:111111118888888888888881111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888811111111
// 031:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111111
// 032:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111111
// 033:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111111
// 034:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111111
// 035:111111111222222222222222111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222221111111
// 036:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 037:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 038:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
@ -940,42 +959,42 @@ const BTN_Y = 7
// 047:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 048:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 049:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 050:111111118888888888888881111188888111118888811111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888811111888881111188888111111111
// 051:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111888882111188888211111111
// 052:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111888882111188888211111111
// 053:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111888882111188888211111111
// 054:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111888882111188888211111111
// 055:111111111222222222222222111112222211111222221111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222221111122222111112222211111111
// 050:111111118888888888888881111188888111118888811111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888881111188888111118888811111111
// 051:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888211118888821111111
// 052:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888211118888821111111
// 053:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888211118888821111111
// 054:111111118888888888888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888888888888882111188888211118888821111111
// 055:111111111222222222222222111112222211111222221111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111222222222222222111112222211111222221111111
// 056:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 057:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 058:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 059:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 060:111111118888811111888888888888888111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888811111888888888888888111111111
// 061:111111118888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888888888888888211111111
// 062:111111118888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888888888888888211111111
// 063:111111118888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888888888888888211111111
// 064:111111118888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888888888888888211111111
// 065:111111111222221111122222222222222211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111222221111122222222222222211111111
// 060:111111118888811111888888888888888111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888881111188888888888888811111111
// 061:111111118888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888888888888821111111
// 062:111111118888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888888888888821111111
// 063:111111118888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888888888888821111111
// 064:111111118888821111888888888888888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888888888888821111111
// 065:111111111222221111122222222222222211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222111112222222222222221111111
// 066:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 067:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 068:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 069:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 070:111111118888811111888881111188888111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888811111888881111188888111111111
// 071:111111118888821111888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888882111188888211111111
// 072:111111118888821111888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888882111188888211111111
// 073:111111118888821111888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888882111188888211111111
// 074:111111118888821111888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888882111188888211111111
// 075:111111111222221111122222111112222211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111222221111122222111112222211111111
// 070:111111118888811111888881111188888111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888881111188888111118888811111111
// 071:111111118888821111888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888211118888821111111
// 072:111111118888821111888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888211118888821111111
// 073:111111118888821111888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888211118888821111111
// 074:111111118888821111888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888211118888821111111
// 075:111111111222221111122222111112222211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222111112222211111222221111111
// 076:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 077:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 078:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 079:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 080:111111118888811111888881111188888111118888811111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888111118888811111888881111188888111111111
// 081:111111118888821111888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888211118888821111888882111188888211111111
// 082:111111118888821111888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888211118888821111888882111188888211111111
// 083:111111118888821111888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888211118888821111888882111188888211111111
// 084:111111118888821111888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888211118888821111888882111188888211111111
// 085:111111111222221111122222111112222211111222221111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222211111222221111122222111112222211111111
// 080:111111118888811111888881111188888111118888811111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888811111888881111188888111118888811111111
// 081:111111118888821111888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888882111188888211118888821111111
// 082:111111118888821111888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888882111188888211118888821111111
// 083:111111118888821111888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888882111188888211118888821111111
// 084:111111118888821111888882111188888211118888821111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888882111188888211118888821111111
// 085:111111111222221111122222111112222211111222221111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111222221111122222111112222211111222221111111
// 086:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 087:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 088:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
@ -990,32 +1009,32 @@ const BTN_Y = 7
// 097:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 098:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 099:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 100:111111118888811111888888888888888111118888888888888881111188888111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888811111888888888888888111118888888888888881111188888111111111
// 101:111111118888821111888888888888888211118888888888888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888888888888888211118888888888888882111188888211111111
// 102:111111118888821111888888888888888211118888888888888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888888888888888211118888888888888882111188888211111111
// 103:111111118888821111888888888888888211118888888888888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888888888888888211118888888888888882111188888211111111
// 104:111111118888821111888888888888888211118888888888888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118888821111888888888888888211118888888888888882111188888211111111
// 105:111111111222221111122222222222222211111222222222222222111112222211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111222221111122222222222222211111222222222222222111112222211111111
// 100:111111118888811111888888888888888111118888888888888881111188888111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888881111188888888888888811111888888888888888111118888811111111
// 101:111111118888821111888888888888888211118888888888888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888888888888821111888888888888888211118888821111111
// 102:111111118888821111888888888888888211118888888888888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888888888888821111888888888888888211118888821111111
// 103:111111118888821111888888888888888211118888888888888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888888888888821111888888888888888211118888821111111
// 104:111111118888821111888888888888888211118888888888888882111188888211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888888888888821111888888888888888211118888821111111
// 105:111111111222221111122222222222222211111222222222222222111112222211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222111112222222222222221111122222222222222211111222221111111
// 106:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 107:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 108:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 109:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 110:111111118888811111888881111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888881111188888111111111
// 111:111111118888821111888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888211111111
// 112:111111118888821111888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888211111111
// 113:111111118888821111888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888211111111
// 114:111111118888821111888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888882111188888211111111
// 115:111111111222221111122222111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222111112222211111111
// 110:111111118888811111888881111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888111118888811111111
// 111:111111118888821111888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888211118888821111111
// 112:111111118888821111888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888211118888821111111
// 113:111111118888821111888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888211118888821111111
// 114:111111118888821111888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888211118888821111111
// 115:111111111222221111122222111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222211111222221111111
// 116:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 117:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 118:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 119:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 120:111111118888888888888881111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888111111111
// 121:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211111111
// 122:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211111111
// 123:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211111111
// 124:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111888888888888888211111111
// 125:111111111222222222222222111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222211111111
// 120:111111118888888888888881111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888811111111
// 121:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111111
// 122:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111111
// 123:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111111
// 124:111111118888888888888882111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111188888888888888821111111
// 125:111111111222222222222222111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222221111111
// 126:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 127:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
// 128:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111