/*:
 * @target MZ
 * @plugindesc Game Over Ultime (Persona 5 × Néon) — Fond animé, slash, glow, particules, glitch, balayage lumineux
 * @author Bertran
 */

(() => {

    const CFG = {
        bg: "GO_Background",
        slash: "GO_Slash",
        scan: "GO_Scanline",
        text: "GAME OVER",
        fontSize: 96,
        glowColor: "#ff44ff",
        mainColor: "#ffffff",
        appearSlash: 20,
        appearText: 60,
        shakeTime: 25,
        sweepSpeed: 2,
        particleCount: 40
    };

    // ---------------------------------------------------------------------
    // SCENE OVERRIDE
    // ---------------------------------------------------------------------

    Scene_Gameover.prototype.create = function() {
        Scene_Base.prototype.create.call(this);
        this._timer = 0;
        this._shake = 0;
        this.createBackground();
        this.createParticles();
        this.createSlash();
        this.createText();
        this.createScanline();
        this.startFadeIn(this.fadeSpeed(), false);
    };

    Scene_Gameover.prototype.update = function() {
        Scene_Base.prototype.update.call(this);
        this._timer++;

        this.updateBackground();
        this.updateParticles();
        this.updateSlash();
        this.updateText();
        this.updateShake();
        this.updateScanline();

        if (Input.isTriggered("ok") || Input.isTriggered("cancel") || TouchInput.isTriggered()) {
            SceneManager.goto(Scene_Title);
        }
    };

    // ---------------------------------------------------------------------
    // BACKGROUND ANIMÉ
    // ---------------------------------------------------------------------

    Scene_Gameover.prototype.createBackground = function() {
        this._bg = new Sprite(ImageManager.loadPicture(CFG.bg));
        this._bg.anchor.x = 0.5;
        this._bg.anchor.y = 0.5;
        this._bg.x = Graphics.width / 2;
        this._bg.y = Graphics.height / 2;
        this._bg.scale.x = 1.1;
        this._bg.scale.y = 1.1;
        this._bg._rot = 0;
        this.addChild(this._bg);
    };

    Scene_Gameover.prototype.updateBackground = function() {
        this._bg._rot += 0.0008;
        this._bg.rotation = Math.sin(this._bg._rot) * 0.03;
    };

    // ---------------------------------------------------------------------
    // PARTICULES
    // ---------------------------------------------------------------------

    Scene_Gameover.prototype.createParticles = function() {
        this._particles = [];
        for (let i = 0; i < CFG.particleCount; i++) {
            const s = new Sprite(new Bitmap(4, 4));
            s.bitmap.fillAll("#ff66ff");
            s.anchor.x = 0.5;
            s.anchor.y = 0.5;
            s.x = Math.random() * Graphics.width;
            s.y = Math.random() * Graphics.height;
            s._speed = 0.5 + Math.random() * 1.5;
            s.opacity = 100 + Math.random() * 155;
            this.addChild(s);
            this._particles.push(s);
        }
    };

    Scene_Gameover.prototype.updateParticles = function() {
        for (const p of this._particles) {
            p.y -= p._speed;
            p.opacity -= 1;
            if (p.opacity <= 0 || p.y < -10) {
                p.x = Math.random() * Graphics.width;
                p.y = Graphics.height + 20;
                p.opacity = 200;
            }
        }
    };

    // ---------------------------------------------------------------------
    // SLASH
    // ---------------------------------------------------------------------

    Scene_Gameover.prototype.createSlash = function() {
        this._slash = new Sprite(ImageManager.loadPicture(CFG.slash));
        this._slash.anchor.x = 0.5;
        this._slash.anchor.y = 0.5;
        this._slash.x = Graphics.width / 2;
        this._slash.y = Graphics.height / 2;
        this._slash.scale.x = 0;
        this._slash.scale.y = 1;
        this._slash.opacity = 0;
        this.addChild(this._slash);
    };

    Scene_Gameover.prototype.updateSlash = function() {
        if (this._timer < CFG.appearSlash) return;

        const t = this._timer - CFG.appearSlash;

        if (t < 15) {
            this._slash.opacity = 255;
            this._slash.scale.x = t / 10;
        } else {
            this._slash.opacity -= 10;
        }
    };

    // ---------------------------------------------------------------------
    // TEXTE GAME OVER
    // ---------------------------------------------------------------------

    Scene_Gameover.prototype.createText = function() {
        const bmp = new Bitmap(Graphics.width, 200);
        bmp.fontSize = CFG.fontSize;

        this._text = new Sprite(bmp);
        this._text.anchor.x = 0.5;
        this._text.anchor.y = 0.5;
        this._text.x = Graphics.width / 2;
        this._text.y = Graphics.height / 2 + 40;
        this._text.opacity = 0;
        this._text.scale.x = 1.4;
        this._text.scale.y = 1.4;
        this._text._sweep = 0;
        this.addChild(this._text);
    };

    Scene_Gameover.prototype.updateText = function() {
        if (this._timer < CFG.appearText) return;

        const t = this._timer - CFG.appearText;

        if (t === 0) this._shake = CFG.shakeTime;

        if (t < 30) {
            this._text.opacity = t * 10;
            const s = 1.4 - t * 0.01;
            this._text.scale.x = s;
            this._text.scale.y = s;
        } else {
            this._text.opacity = 255;
        }

        this._text._sweep += CFG.sweepSpeed;

        const bmp = this._text.bitmap;
        bmp.clear();

        const w = bmp.width;
        const h = bmp.height;

        // Glow
        bmp.textColor = CFG.glowColor;
        bmp.paintOpacity = 80;
        for (let i = -3; i <= 3; i++) {
            bmp.drawText(CFG.text, i, i, w, h, "center");
        }

        // Texte principal
        bmp.paintOpacity = 255;
        bmp.textColor = CFG.mainColor;
        bmp.drawText(CFG.text, 0, 0, w, h, "center");

        // Balayage lumineux
        const sweepX = (this._text._sweep % w) - w / 2;
        bmp.gradientFillRect(sweepX, 0, 80, h, "#ffffff55", "#ffffff00", true);
    };

    // ---------------------------------------------------------------------
    // SHAKE
    // ---------------------------------------------------------------------

    Scene_Gameover.prototype.updateShake = function() {
        if (this._shake > 0) {
            this._shake--;
            const p = this._shake * 0.4;
            this.x = (Math.random() - 0.5) * p;
            this.y = (Math.random() - 0.5) * p;
        } else {
            this.x = 0;
            this.y = 0;
        }
    };

    // ---------------------------------------------------------------------
    // SCANLINE / GLITCH
    // ---------------------------------------------------------------------

    Scene_Gameover.prototype.createScanline = function() {
        this._scan = new Sprite(ImageManager.loadPicture(CFG.scan));
        this._scan.opacity = 0;
        this._scan.blendMode = 1;
        this.addChild(this._scan);
    };

    Scene_Gameover.prototype.updateScanline = function() {
        if (this._timer > CFG.appearText + 20) {
            this._scan.opacity = 60 + Math.sin(this._timer / 10) * 20;
        }
    };

})();

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: