codex
This commit is contained in:
@@ -55,14 +55,17 @@ export class EndScene extends Phaser.Scene {
|
|||||||
circle.setInteractive({ useHandCursor: true });
|
circle.setInteractive({ useHandCursor: true });
|
||||||
|
|
||||||
// Clic sur le bouton ou n'importe où sur l'écran
|
// Clic sur le bouton ou n'importe où sur l'écran
|
||||||
const startVideo = () => {
|
let startRequested = false; // # modifer par codex + ancien code: (aucun)
|
||||||
message.destroy();
|
const startVideo = () => { // # modifer par codex + ancien code: const startVideo = () => {
|
||||||
playButton.destroy();
|
if (startRequested) return; // # modifer par codex + ancien code: (aucun)
|
||||||
this.playEndVideo();
|
startRequested = true; // # modifer par codex + ancien code: (aucun)
|
||||||
|
message.destroy(); // # modifer par codex + ancien code: message.destroy();
|
||||||
|
playButton.destroy(); // # modifer par codex + ancien code: playButton.destroy();
|
||||||
|
this.playEndVideo(); // # modifer par codex + ancien code: this.playEndVideo();
|
||||||
};
|
};
|
||||||
|
|
||||||
circle.on('pointerdown', startVideo);
|
circle.on('pointerdown', startVideo); // # modifer par codex + ancien code: circle.on('pointerdown', startVideo);
|
||||||
this.input.once('pointerdown', startVideo);
|
this.input.once('pointerdown', startVideo); // # modifer par codex + ancien code: this.input.once('pointerdown', startVideo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,6 +76,8 @@ export class EndScene extends Phaser.Scene {
|
|||||||
|
|
||||||
console.log('[EndScene] Vidéo dans cache?', this.cache.video.exists('end'));
|
console.log('[EndScene] Vidéo dans cache?', this.cache.video.exists('end'));
|
||||||
|
|
||||||
|
if (this.video) return; // # modifer par codex + ancien code: (aucun)
|
||||||
|
|
||||||
if (!this.cache.video.exists('end')) {
|
if (!this.cache.video.exists('end')) {
|
||||||
console.warn('[EndScene] Vidéo de fin non trouvée → passage au menu.');
|
console.warn('[EndScene] Vidéo de fin non trouvée → passage au menu.');
|
||||||
this.gotoMenu();
|
this.gotoMenu();
|
||||||
@@ -272,15 +277,15 @@ export class EndScene extends Phaser.Scene {
|
|||||||
private showSuccessMessage(): void {
|
private showSuccessMessage(): void {
|
||||||
// Message "Niveau 1 réussi!"
|
// Message "Niveau 1 réussi!"
|
||||||
const successText = this.add.text(
|
const successText = this.add.text(
|
||||||
this.cameras.main.width / 2,
|
this.cameras.main.width / 2, // # modifer par codex + ancien code: this.cameras.main.width / 2,
|
||||||
this.cameras.main.height / 2 - 100,
|
this.cameras.main.height / 2 + 40, // # modifer par codex + ancien code: this.cameras.main.height / 2 - 100,
|
||||||
'Niveau 1 réussi!',
|
'Niveau 1 réussi!', // # modifer par codex + ancien code: 'Niveau 1 réussi!',
|
||||||
{
|
{
|
||||||
fontSize: '64px',
|
fontSize: '64px', // # modifer par codex + ancien code: fontSize: '64px',
|
||||||
color: '#FFD700',
|
color: '#FFD700', // # modifer par codex + ancien code: color: '#FFD700',
|
||||||
stroke: '#000000',
|
stroke: '#000000', // # modifer par codex + ancien code: stroke: '#000000',
|
||||||
strokeThickness: 8,
|
strokeThickness: 8, // # modifer par codex + ancien code: strokeThickness: 8,
|
||||||
fontStyle: 'bold',
|
fontStyle: 'bold', // # modifer par codex + ancien code: fontStyle: 'bold',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
successText.setOrigin(0.5);
|
successText.setOrigin(0.5);
|
||||||
@@ -297,7 +302,7 @@ export class EndScene extends Phaser.Scene {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Bouton "Passer au niveau 2"
|
// Bouton "Passer au niveau 2"
|
||||||
const buttonY = this.cameras.main.height / 2 + 100;
|
const buttonY = this.cameras.main.height / 2 - 100; // # modifer par codex + ancien code: const buttonY = this.cameras.main.height / 2 + 100;
|
||||||
|
|
||||||
// Fond du bouton
|
// Fond du bouton
|
||||||
const buttonBg = this.add.rectangle(
|
const buttonBg = this.add.rectangle(
|
||||||
@@ -305,12 +310,13 @@ export class EndScene extends Phaser.Scene {
|
|||||||
buttonY,
|
buttonY,
|
||||||
400,
|
400,
|
||||||
80,
|
80,
|
||||||
0x4CAF50
|
0x4CAF50 // # modifer par codex + ancien code: 0x4CAF50
|
||||||
);
|
);
|
||||||
buttonBg.setOrigin(0.5);
|
buttonBg.setOrigin(0.5);
|
||||||
buttonBg.setDepth(999);
|
buttonBg.setDepth(999);
|
||||||
buttonBg.setInteractive({ useHandCursor: true });
|
buttonBg.setInteractive({ useHandCursor: true });
|
||||||
buttonBg.setAlpha(0);
|
buttonBg.setFillStyle(0x4CAF50, 0.8); // # modifer par codex + ancien code: (aucun)
|
||||||
|
buttonBg.setAlpha(0); // # modifer par codex + ancien code: buttonBg.setAlpha(0);
|
||||||
|
|
||||||
// Texte du bouton
|
// Texte du bouton
|
||||||
const buttonText = this.add.text(
|
const buttonText = this.add.text(
|
||||||
@@ -330,15 +336,15 @@ export class EndScene extends Phaser.Scene {
|
|||||||
// Animation d'apparition du bouton (un peu après le texte)
|
// Animation d'apparition du bouton (un peu après le texte)
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: [buttonBg, buttonText],
|
targets: [buttonBg, buttonText],
|
||||||
alpha: 1,
|
alpha: 1, // # modifer par codex + ancien code: alpha: 1,
|
||||||
duration: 600,
|
duration: 600, // # modifer par codex + ancien code: duration: 600,
|
||||||
delay: 400,
|
delay: 400, // # modifer par codex + ancien code: delay: 400,
|
||||||
ease: 'Power2',
|
ease: 'Power2', // # modifer par codex + ancien code: ease: 'Power2',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Effet hover sur le bouton
|
// Effet hover sur le bouton
|
||||||
buttonBg.on('pointerover', () => {
|
buttonBg.on('pointerover', () => {
|
||||||
buttonBg.setFillStyle(0x66BB6A);
|
buttonBg.setFillStyle(0x66BB6A, 0.9); // # modifer par codex + ancien code: buttonBg.setFillStyle(0x66BB6A);
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: buttonBg,
|
targets: buttonBg,
|
||||||
scaleX: 1.05,
|
scaleX: 1.05,
|
||||||
@@ -348,7 +354,7 @@ export class EndScene extends Phaser.Scene {
|
|||||||
});
|
});
|
||||||
|
|
||||||
buttonBg.on('pointerout', () => {
|
buttonBg.on('pointerout', () => {
|
||||||
buttonBg.setFillStyle(0x4CAF50);
|
buttonBg.setFillStyle(0x4CAF50, 0.8); // # modifer par codex + ancien code: buttonBg.setFillStyle(0x4CAF50);
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: buttonBg,
|
targets: buttonBg,
|
||||||
scaleX: 1,
|
scaleX: 1,
|
||||||
|
|||||||
@@ -1142,15 +1142,18 @@ export class GameScene extends Phaser.Scene {
|
|||||||
this.addScore(500);
|
this.addScore(500);
|
||||||
this.playSfx('sfx_super', 0.6);
|
this.playSfx('sfx_super', 0.6);
|
||||||
|
|
||||||
// BONUS DE TEMPS : +5 secondes
|
// BONUS DE TEMPS : +10 secondes // # modifer par codex + ancien code: // BONUS DE TEMPS : +5 secondes
|
||||||
this.timeRemaining += 5;
|
const bonusSeconds = 10; // # modifer par codex + ancien code: (aucun)
|
||||||
console.log('⏱️ Super Trésor : +5 secondes ! Temps restant:', this.timeRemaining);
|
this.gameStartTime += bonusSeconds * 1000; // # modifer par codex + ancien code: this.gameStartTime -= bonusSeconds * 1000;
|
||||||
|
this.timeRemaining += bonusSeconds; // # modifer par codex + ancien code: this.timeRemaining += 5;
|
||||||
|
this.updateTimer(this.time.now); // # modifer par codex + ancien code: (aucun)
|
||||||
|
console.log('⏱️ Super Trésor : +10 secondes ! Temps restant:', this.timeRemaining); // # modifer par codex + ancien code: console.log('⏱️ Super Trésor : +5 secondes ! Temps restant:', this.timeRemaining);
|
||||||
|
|
||||||
// Message spécial
|
// Message spécial
|
||||||
const bonusText = this.add.text(
|
const bonusText = this.add.text(
|
||||||
this.cameras.main.scrollX + this.cameras.main.width / 2,
|
this.cameras.main.scrollX + this.cameras.main.width / 2,
|
||||||
this.cameras.main.height / 2,
|
this.cameras.main.height / 2,
|
||||||
'★ SUPER TRÉSOR +500 ★\n⏱️ +5 SECONDES ⏱️',
|
'★ SUPER TRÉSOR +500 ★\n⏱️ +10 SECONDES ⏱️', // # modifer par codex + ancien code: '★ SUPER TRÉSOR +500 ★\n⏱️ +5 SECONDES ⏱️',
|
||||||
{
|
{
|
||||||
fontSize: '48px',
|
fontSize: '48px',
|
||||||
color: '#FFD700',
|
color: '#FFD700',
|
||||||
|
|||||||
Reference in New Issue
Block a user