时间拉长

This commit is contained in:
WIN-GKKD951VVMJ\Administrator 2026-09-15 17:23:46 +08:00
parent f3a7653f8f
commit 28215af395
2 changed files with 9 additions and 6 deletions

View File

@ -1,7 +1,8 @@
export const RAINBOW_COLOR = 100;
export const RAINBOW_CAPACITY = 30;
export const RAINBOW_CELL_ENERGY = 3;
export const RAINBOW_CAST_SECONDS = 0.3;
// 临时放慢飞行以便测试;飞行结束后才裁切方块,正式时长为 0.3 秒。
export const RAINBOW_CAST_SECONDS = 1.5;
export interface RainbowCell { x: number; y: number; }
export interface RainbowCut {

View File

@ -178,7 +178,7 @@ function controllerFixture(blocks = [block(), block()]) {
return { controller, map, bottle, applied, blocks };
}
test('first press excludes the whole dragged group; .3 s lock retains finger without catch-up movement', () => {
test('first press excludes the whole dragged group; 1.5 s flight keeps input locked until the cut', () => {
const f = controllerFixture(); const first = f.blocks[0];
first.isTouch = true; first.node.parent = new Node(); first.node.setPosition(30, 40);
f.map.touchIng = true;
@ -186,8 +186,10 @@ test('first press excludes the whole dragged group; .3 s lock retains finger wit
assert.equal(f.controller.casting, true); assert.equal(f.controller.selection.block, f.blocks[1]);
assert.equal(f.map.pause, undefined); assert.equal(f.controller.energy.value, 0);
f.controller.capture(first, { getLocation: () => v2(100, 200) }, false);
f.controller.update(.29); assert.equal(f.applied.length, 0);
f.controller.update(1.49); assert.equal(f.applied.length, 0);
assert.equal(f.controller.casting, true); assert.equal(f.controller.shield.active, true);
f.controller.update(.01); assert.equal(f.applied.length, 1); assert.equal(f.controller.casting, false);
assert.equal(f.controller.shield, null);
assert.deepEqual(plain(first.relative_Position), { x: -70, y: -160 });
assert.equal(first.touchDelta.mag(), 0); assert.equal(first.isTouch, true);
});
@ -198,8 +200,8 @@ test('release during flight settles once; lost target consumes cast; only dragge
first.touchEnd = () => { ends++; first.isTouch = false; };
f.controller.onPress(first, { getLocation: () => v2() });
f.controller.capture(first, { getLocation: () => v2(4, 5) }, true);
f.map.blocks.pop(); f.controller.update(.3); f.controller.update(.3);
assert.equal(ends, 1); assert.equal(f.applied.length, 0); assert.ok(f.controller.energy.value < 1);
f.map.blocks.pop(); f.controller.update(rules.RAINBOW_CAST_SECONDS); f.controller.update(rules.RAINBOW_CAST_SECONDS);
assert.equal(ends, 1); assert.equal(f.applied.length, 0); assert.equal(f.controller.energy.value, 2 * rules.RAINBOW_CAST_SECONDS);
const linked = controllerFixture(); linked.blocks[0].teamBlocks = linked.map.blocks;
linked.controller.onPress(linked.blocks[0], { getLocation: () => v2() });
assert.equal(linked.controller.energy.value, 0); assert.equal(linked.controller.casting, false);
@ -406,7 +408,7 @@ test('normal casts wait for release animation; a prior partial hammer hit does n
f.controller.update(.1); assert.equal(f.controller.casting,false);
exit.active = false; f.controller.update(.1); assert.equal(f.controller.casting,true);
f.map.pause = true; f.controller.update(10); assert.equal(f.applied.length,0);
f.map.pause = false; f.controller.update(.3); assert.equal(f.applied.length,1);
f.map.pause = false; f.controller.update(rules.RAINBOW_CAST_SECONDS); assert.equal(f.applied.length,1);
});
test('browser startup has ten wins before entering GameScene; disabling test mode restores normal defaults', () => {