完成六区域银河城战役与16帧美术资源

This commit is contained in:
2026-07-16 15:42:39 +08:00
parent 42080fb6b0
commit 170f0a2ed5
114 changed files with 2109 additions and 11 deletions
+14 -11
View File
@@ -178,9 +178,9 @@
{x:15310,y:390,text:'「想要」',taken:false},{x:18180,y:305,text:'「被找到」',taken:false},
{x:23020,y:305,text:'「真正的我」',taken:false},{x:26150,y:305,text:'「活下去」',taken:false},
{x:29820,y:390,text:'「下雨以后」',taken:false},{x:32360,y:305,text:'「绕一点路」',taken:false},
{x:34750,y:390,text:'「也没有关系」',taken:false},{x:37420,y:305,text:'「我不想再」',taken:false},
{x:39760,y:390,text:'「只回答正确答案」',taken:false},{x:42140,y:305,text:'「请听我说」',taken:false},
{x:44480,y:390,text:'「这是我的」',taken:false},{x:46850,y:305,text:'「第一首歌」',taken:false}
{x:34600,y:401,text:'「也没有关系」',taken:false},{x:37420,y:305,text:'「我不想再」',taken:false},
{x:39760,y:316,text:'「只回答正确答案」',taken:false},{x:42140,y:305,text:'「请听我说」',taken:false},
{x:44480,y:486,text:'「这是我的」',taken:false},{x:46950,y:316,text:'「第一首歌」',taken:false}
];
const ROOM_LAYOUTS = [
@@ -206,7 +206,7 @@
{ground:[[0,2400]],ledges:[[430,525,320],[850,440,320],[1290,355,360],[1780,440,330]]}
];
const platforms=ROOM_LAYOUTS.flatMap((layout,index)=>{const start=index*ROOM_W;return[...layout.ground.map(([x,w])=>({x:start+x,y:610,w,h:130})),...layout.ledges.map(([x,y,w])=>({x:start+x,y,w,h:24}))];});
const spikes = [{x:3850,y:592,w:100},{x:5310,y:592,w:100},{x:11100,y:592,w:110},{x:13300,y:592,w:110},{x:18300,y:592,w:100},{x:19700,y:592,w:110},{x:20850,y:592,w:100},{x:25400,y:592,w:110},{x:29620,y:592,w:100},{x:31640,y:592,w:110},{x:36940,y:592,w:110},{x:39320,y:592,w:110},{x:43780,y:592,w:100}];
const spikes = [{x:3850,y:592,w:100},{x:5310,y:592,w:100},{x:11100,y:592,w:110},{x:13300,y:592,w:110},{x:18300,y:592,w:100},{x:19700,y:592,w:110},{x:20850,y:592,w:100},{x:25400,y:592,w:110},{x:29660,y:592,w:100},{x:31640,y:592,w:110},{x:36940,y:592,w:110},{x:39320,y:592,w:110},{x:43780,y:592,w:100}];
const door = {x:15720,y:380,w:48,h:230};
const shrine = {x:10020,y:490,w:92,h:120,taken:false,kind:'shrine'};
const airShrine = {x:34620,y:490,w:92,h:120,taken:false,kind:'airShrine'};
@@ -219,16 +219,16 @@
{x:41040,y:510,w:180,h:100,kind:'bench'},
{x:45840,y:510,w:180,h:100,kind:'bench'}
];
const relays = [{x:10500,y:552,w:36,h:58,pair:'aquarium'},{x:13980,y:467,w:36,h:58,pair:'aquarium'},{x:31980,y:552,w:36,h:58,pair:'rain'},{x:41880,y:467,w:36,h:58,pair:'rain'}];
const relays = [{x:10500,y:552,w:36,h:58,pair:'aquarium'},{x:13980,y:467,w:36,h:58,pair:'aquarium'},{x:31980,y:552,w:36,h:58,pair:'rain'},{x:41880,y:382,w:36,h:58,pair:'rain'}];
const terminals = [
{x:260,y:500,w:108,h:110,id:'entry',kind:'terminal',title:'未发送的登录记录',speaker:'SYSTEM',text:'25:00。账号「雪」仍在线,但语音轨道没有输入。'},
{x:7850,y:500,w:108,h:110,id:'aquarium',kind:'terminal',title:'水族馆记忆:蓝色',speaker:'K',text:'你说喜欢水族馆的时候,声音没有在说谎。'},
{x:17060,y:500,w:108,h:110,id:'nightcord',kind:'terminal',title:'Nightcord 断线缓存',speaker:'Enanan',text:'连接断掉也没关系。想说的时候,再把真正的话发给我们。'},
{x:24260,y:500,w:108,h:110,id:'backstage',kind:'terminal',title:'无声舞台:演出指令',speaker:'まふゆ',text:'这次,我不想按照别人写好的台词笑。'},
{x:29480,y:500,w:108,h:110,id:'rooftop',kind:'terminal',title:'雨幕天台:未发送语音',speaker:'Amia',text:'偶尔绕路也可以呀。没有人规定你必须马上到达正确答案。'},
{x:28890,y:500,w:108,h:110,id:'rooftop',kind:'terminal',title:'雨幕天台:未发送语音',speaker:'Amia',text:'偶尔绕路也可以呀。没有人规定你必须马上到达正确答案。'},
{x:34080,y:500,w:108,h:110,id:'classroom',kind:'terminal',title:'镜像教室:值日日志',speaker:'Enanan',text:'镜子里的笑不是假的,只是你不必永远维持它。'},
{x:41320,y:500,w:108,h:110,id:'hall',kind:'terminal',title:'失声礼堂:空白谱面',speaker:'K',text:'第一小节不用完整。只要是你写下的,就足够开始。'},
{x:43880,y:500,w:108,h:110,id:'dressing',kind:'terminal',title:'无名化妆间:卸下的面具',speaker:'まふゆ',text:'我还不知道真正的自己是什么。但我想继续寻找。'}
{x:40520,y:500,w:108,h:110,id:'hall',kind:'terminal',title:'失声礼堂:空白谱面',speaker:'K',text:'第一小节不用完整。只要是你写下的,就足够开始。'},
{x:43480,y:500,w:108,h:110,id:'dressing',kind:'terminal',title:'无名化妆间:卸下的面具',speaker:'まふゆ',text:'我还不知道真正的自己是什么。但我想继续寻找。'}
];
const memoryLamps = [
{x:30240,y:470,w:86,h:140,kind:'lamp',id:'roof',lit:false},{x:32640,y:470,w:86,h:140,kind:'lamp',id:'rain',lit:false},
@@ -240,7 +240,7 @@
{x:9780,y:430,w:980,h:180,label:'共鸣静室'},{x:16920,y:430,w:700,h:180,label:'断线静默区'},
{x:21720,y:430,w:760,h:180,label:'后台休息站'},{x:24120,y:430,w:700,h:180,label:'幕间静默区'},
{x:28800,y:430,w:520,h:180,label:'天台雨棚'},{x:33600,y:430,w:760,h:180,label:'镜像教室静区'},
{x:36000,y:430,w:620,h:180,label:'放学路候车亭'},{x:40800,y:430,w:720,h:180,label:'礼堂前厅'},
{x:36000,y:430,w:620,h:180,label:'放学路候车亭'},{x:40320,y:430,w:480,h:180,label:'谱库静读区'},{x:40800,y:430,w:720,h:180,label:'礼堂前厅'},{x:43200,y:430,w:920,h:180,label:'化妆间静区'},
{x:45600,y:430,w:560,h:180,label:'最终幕准备区'}
];
const safeZoneGlow=ctx.createLinearGradient(0,430,0,610);safeZoneGlow.addColorStop(0,'rgba(143,241,245,0)');safeZoneGlow.addColorStop(1,'rgba(143,241,245,.12)');
@@ -860,7 +860,10 @@
}else if(e.type==='sentinel'){
e.y=approach(e.y,e.homeY+Math.sin(e.t*1.6)*10,38*dt);if(e.state==='alert'){holdEnemyFacing(e,Math.abs(dx)>32?Math.sign(dx):0);if(e.attackClock<=0){for(let i=-1;i<=1;i++){const a=Math.atan2(player.y-e.y,dx)+i*.17;fireProjectile(e.x+21,e.y+25,Math.cos(a)*210,Math.sin(a)*210,'note');}playSfx('enemyShot',.42,.92);e.attackClock=2.65;}}
}else if(e.type==='maskling'){
const config=ENEMY_AI.maskling,targetX=e.state==='alert'?e.lastSeenX:e.homeX+Math.sin(e.t*.72)*config.roam,targetY=e.state==='alert'?player.y+8:e.homeY+Math.sin(e.t*2.1)*28;e.dir=holdEnemyFacing(e,Math.abs(targetX-e.x)>24?Math.sign(targetX-e.x):0,.2);e.x=approach(e.x,targetX,(e.state==='alert'?config.chase:config.patrol)*dt);e.y=approach(e.y,targetY,(e.state==='alert'?88:44)*dt);if(e.state==='alert'&&e.attackClock<=0&&near<420){const d=Math.hypot(dx,player.y-e.y)||1;e.vx=dx/d*330;e.vy=(player.y-e.y)/d*260;e.attackClock=2.05;playSfx('enemyShot',.32,1.34);}
const config=ENEMY_AI.maskling,targetX=e.state==='alert'?e.lastSeenX:e.homeX+Math.sin(e.t*.72)*config.roam,targetY=e.state==='alert'?player.y+8:e.homeY+Math.sin(e.t*2.1)*28;e.dir=holdEnemyFacing(e,Math.abs(targetX-e.x)>24?Math.sign(targetX-e.x):0,.2);
if(e.attackClock>1.58){e.x+=e.vx*dt;e.y+=e.vy*dt;e.vx*=Math.pow(.2,dt);e.vy*=Math.pow(.24,dt);}
else{e.x=approach(e.x,targetX,(e.state==='alert'?config.chase:config.patrol)*dt);e.y=approach(e.y,targetY,(e.state==='alert'?88:44)*dt);}
if(e.state==='alert'&&e.attackClock<=0&&near<420){const d=Math.hypot(dx,player.y-e.y)||1;e.vx=dx/d*330;e.vy=(player.y-e.y)/d*260;e.attackClock=2.05;playSfx('enemyShot',.32,1.34);}
}else if(e.type==='metronome'){
const config=ENEMY_AI.metronome;steerGroundEnemy(e,dt,e.state==='alert'?config.chase:config.patrol,e.state==='alert'?590:280);moveGroundEnemySafely(e,dt);if(e.state==='alert'&&e.attackClock<=0&&near<390){const a=Math.atan2(player.y+30-(e.y+34),dx);fireProjectile(e.x+e.w/2,e.y+34,Math.cos(a)*255,Math.sin(a)*255,'blade');playSfx('enemyShot',.38,.76);e.attackClock=2.4;}
}else if(e.type==='rainChoir'){
@@ -879,7 +882,7 @@
}
}else if(e.type==='mirror'){
if(!finalArenaActive)continue;e.phase=e.hp<e.maxHp*.34?2:e.hp<e.maxHp*.68?1:0;const facing=Math.abs(dx)>44?Math.sign(dx):e.dir;holdEnemyFacing(e,facing,.13);e.vy=Math.min(900,e.vy+1700*dt);if(near>210)e.vx=approach(e.vx,e.dir*(105+e.phase*26),410*dt);else e.vx*=Math.pow(.035,dt);moveEntity(e,dt);
if(e.attackClock<=0){const pattern=(Math.floor(e.t*2.7)+e.phase)%3;if(pattern===0){const count=7+e.phase*2;for(let i=0;i<count;i++){const a=-Math.PI*.92+i*(Math.PI*1.84/(count-1));fireProjectile(e.x+e.w/2,e.y+42,Math.cos(a)*(205+e.phase*24),Math.sin(a)*(205+e.phase*24),'script');}}else if(pattern===1){const room=ROOMS[19];for(let i=0;i<6+e.phase;i++){const x=room.start+190+((i*337+Math.floor(e.t*100))%(ROOM_W-380));fireProjectile(x,70+(i%2)*34,(i%2?28:-28),235+e.phase*24,'rain');}}else{e.dir=Math.sign(dx)||e.dir;e.vx=e.dir*(430+e.phase*70);player.invuln=Math.max(player.invuln,.08);spawn(e.x+e.w/2,e.y+64,'#f4a8e4',18,190);}e.attackClock=2.15-e.phase*.32;shake=8+e.phase*2;playSfx('bossCast',.78,.92+e.phase*.06);tone(118,.28,'sawtooth',.03);}
if(e.attackClock<=0){const pattern=(Math.floor(e.t*2.7)+e.phase)%3;if(pattern===0){const count=7+e.phase*2;for(let i=0;i<count;i++){const a=-Math.PI*.92+i*(Math.PI*1.84/(count-1));fireProjectile(e.x+e.w/2,e.y+42,Math.cos(a)*(205+e.phase*24),Math.sin(a)*(205+e.phase*24),'script');}}else if(pattern===1){const room=ROOMS[19];for(let i=0;i<6+e.phase;i++){const x=room.start+190+((i*337+Math.floor(e.t*100))%(ROOM_W-380));fireProjectile(x,70+(i%2)*34,(i%2?28:-28),235+e.phase*24,'rain');}}else{e.dir=Math.sign(dx)||e.dir;e.vx=e.dir*(430+e.phase*70);spawn(e.x+e.w/2,e.y+64,'#f4a8e4',18,190);}e.attackClock=2.15-e.phase*.32;shake=8+e.phase*2;playSfx('bossCast',.78,.92+e.phase*.06);tone(118,.28,'sawtooth',.03);}
}
repelEnemyFromSafeZones(e);containEnemyInHomeRoom(e);
if(!isBossType(e.type)&&e.y>H+120){onEnemyDefeated(e);continue;}