From 0d2d8cd897e94bd94e0b3ae7c6ce9aa580a44a0a Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Wed, 26 Aug 2026 23:47:59 -0400 Subject: Add a_tension_span --- 2026/games/crm148/game.js | 101 ---------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 2026/games/crm148/game.js (limited to '2026/games/crm148/game.js') diff --git a/2026/games/crm148/game.js b/2026/games/crm148/game.js deleted file mode 100644 index 00f1cc6..0000000 --- a/2026/games/crm148/game.js +++ /dev/null @@ -1,101 +0,0 @@ - -import { View, globalView } from './view.js'; -import { getCosmos } from './cosmos.js'; -import Vec2 from './vec2.js'; - -import { victory, death, initInput, getDebugInfo } from './control.js'; - -startButton.onclick = function (ev) { - window.postMessage({op:"start", difficulty: 1}); -} - -plusButton.onclick = function(ev) { - window.testAngle += 0.1; -} - -minusButton.onclick = function(ev) { - window.testAngle -= 0.1; -} - -testButton.onclick = function (ev) { - if (!cosmos) { - cosmos = getCosmos(); - cosmos.init(1); - initInput(cosmos); - } - - cosmos.running = false; - cosmos.player.state = 'start_testing'; - - cosmos.pulses = [ - new Pulse(Math.PI / 4, Math.PI, 70, 0, 30), - ]; - - cosmos.update(0); - cosmos.render(); - - // if (!cosmos.running) { - // if (lasttime === undefined) { - // render(0); - // lasttime = undefined; - // starttime = undefined; - // } else { - // render(lasttime); - // } - // } -} - -var cosmos; - -function start(difficulty) { - cosmos = getCosmos(); - cosmos.init(difficulty); - initInput(cosmos); - - window.requestAnimationFrame(render); - // TODO: set up mouse input listener, remove it on game over - window.parent.postMessage({op: "started", verb: "dodge!"}); -} - -// input - mouse click -// point the ship and thrust -// add particle (time, position, velocity) -// expire the particles - maybe wait until all of them are over time limit so -// new ones keep the old ones alive -// fade to black and keep it there -// smoke on the grey background of space - -// TODO: game is over after some amount of energy (increases with difficulty) is -// expelled from the star -function nop() { - ; -} - -var starttime; -var lasttime; -// var start = startGame; - -function render(timestamp) { - if (starttime === undefined) { - starttime = timestamp; - lasttime = starttime; - } else { - nop(); - } - // const elapsed = timestamp - starttime; - const dt = (timestamp - lasttime) / 1000.0; - cosmos.update(dt); - cosmos.render(); - lasttime = timestamp; - if (cosmos.running) { - window.requestAnimationFrame(render); - } else { - // console.log('over'); - } -} - - -export { - start, -} - -- cgit v1.3.1