노이즈 캐릭터한테 오러 블레이드가 나가는 효과를 추가해줘. 임시로할거야. createSlashTrail(startAngle, endAngle) { const…
Jump to turn (6)
- User
노이즈 캐릭터한테 오러 블레이드가 나가는 효과를 추가해줘. 임시로할거야. createSlashTrail(startAngle, endAngle) { const trail = this.add.graphics(); trail.setDepth(this.sword.depth + 10); // 검보다 앞에
codeconst centerX = this.player.x; const centerY = this.player.y - 20; // 검 중심 위치 let progress = 0; const trailTween = this.tweens.addCounter({ from: 0, to: 1, duration: 300, onUpdate: (tween) => { progress = tween.getValue(); trail.clear(); const currentAngle = Phaser.Math.Linear(startAngle, endAngle, progress); const alpha = 1 - progress; // 점점 투명해짐 trail.lineStyle(18, 0x88ffff, alpha * 0.9); // 두꺼운 오러 trail.arc(centerX, centerY, 55, Phaser.Math.DegToRad(startAngle), Phaser.Math.DegToRad(currentAngle)); // 더 밝은 안쪽 선 (이중 오러 느낌) trail.lineStyle(8, 0xffffff, alpha * 0.7); trail.arc(centerX, centerY, 52, Phaser.Math.DegToRad(startAngle), Phaser.Math.DegToRad(currentAngle)); }, onComplete: () => { trail.destroy(); } });