Skip to content

Commit 7e472fd

Browse files
committed
feat: update spawn wipe visuals for improved transition effects
1 parent cd2a799 commit 7e472fd

2 files changed

Lines changed: 15 additions & 21 deletions

File tree

src/GameScene.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,27 +1055,22 @@ export class GameScene extends Phaser.Scene {
10551055
const minX = -overscan;
10561056
const maxX = VIEWPORT.width + overscan;
10571057
const centerX = VIEWPORT.width * 0.5;
1058-
const shoulderInset = SPAWN_WIPE_VISUALS.shoulderInset;
1059-
const halfHead = SPAWN_WIPE_VISUALS.headWidth * 0.5;
1058+
const halfPoint = SPAWN_WIPE_VISUALS.pointWidth * 0.5;
10601059

10611060
if (edge === "top") {
1062-
this.spawnWipe.moveTo(minX, baseY + SPAWN_WIPE_VISUALS.shoulderLift);
1063-
this.spawnWipe.lineTo(centerX - shoulderInset, baseY + SPAWN_WIPE_VISUALS.shoulderLift);
1064-
this.spawnWipe.lineTo(centerX - halfHead, baseY + SPAWN_WIPE_VISUALS.shoulderLift);
1065-
this.spawnWipe.lineTo(centerX, baseY - SPAWN_WIPE_VISUALS.headDepth);
1066-
this.spawnWipe.lineTo(centerX + halfHead, baseY + SPAWN_WIPE_VISUALS.shoulderLift);
1067-
this.spawnWipe.lineTo(centerX + shoulderInset, baseY + SPAWN_WIPE_VISUALS.shoulderLift);
1068-
this.spawnWipe.lineTo(maxX, baseY + SPAWN_WIPE_VISUALS.shoulderLift);
1061+
this.spawnWipe.moveTo(minX, baseY);
1062+
this.spawnWipe.lineTo(centerX - halfPoint, baseY);
1063+
this.spawnWipe.lineTo(centerX, baseY - SPAWN_WIPE_VISUALS.pointDepth);
1064+
this.spawnWipe.lineTo(centerX + halfPoint, baseY);
1065+
this.spawnWipe.lineTo(maxX, baseY);
10691066
return;
10701067
}
10711068

1072-
this.spawnWipe.lineTo(maxX, baseY - SPAWN_WIPE_VISUALS.shoulderLift);
1073-
this.spawnWipe.lineTo(centerX + shoulderInset, baseY - SPAWN_WIPE_VISUALS.shoulderLift);
1074-
this.spawnWipe.lineTo(centerX + halfHead, baseY - SPAWN_WIPE_VISUALS.shoulderLift);
1075-
this.spawnWipe.lineTo(centerX, baseY - SPAWN_WIPE_VISUALS.tailDepth);
1076-
this.spawnWipe.lineTo(centerX - halfHead, baseY - SPAWN_WIPE_VISUALS.shoulderLift);
1077-
this.spawnWipe.lineTo(centerX - shoulderInset, baseY - SPAWN_WIPE_VISUALS.shoulderLift);
1078-
this.spawnWipe.lineTo(minX, baseY - SPAWN_WIPE_VISUALS.shoulderLift);
1069+
this.spawnWipe.lineTo(maxX, baseY);
1070+
this.spawnWipe.lineTo(centerX + halfPoint, baseY);
1071+
this.spawnWipe.lineTo(centerX, baseY - SPAWN_WIPE_VISUALS.pointDepth);
1072+
this.spawnWipe.lineTo(centerX - halfPoint, baseY);
1073+
this.spawnWipe.lineTo(minX, baseY);
10791074
}
10801075

10811076
private createRefills(spawns: ReadonlyArray<RefillPickupEntity>): void {

src/view/deathRespawn.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { VIEWPORT } from "../constants";
2+
13
export type SpawnTransitionKind = "initial" | "normal" | "spike";
24

35
export interface SpawnIntroSample {
@@ -22,11 +24,8 @@ export const SPAWN_SEQUENCE_TIMING = {
2224
export const SPAWN_WIPE_VISUALS = {
2325
edgeOverscan: 24,
2426
color: 0x000000,
25-
headWidth: 156,
26-
headDepth: 26,
27-
shoulderInset: 42,
28-
shoulderLift: 5,
29-
tailDepth: 18,
27+
pointWidth: VIEWPORT.width + 24 * 2,
28+
pointDepth: 64,
3029
} as const;
3130

3231
export const SPAWN_INTRO_VISUALS = {

0 commit comments

Comments
 (0)