diff --git a/src/game-entry.js b/src/game-entry.js index d4e971a..24b3697 100644 --- a/src/game-entry.js +++ b/src/game-entry.js @@ -1,28 +1 @@ -import Phaser from 'phaser'; - -const originalRestart = Phaser.Scenes.ScenePlugin.prototype.restart; -Phaser.Scenes.ScenePlugin.prototype.restart = function restartWithFreshRunState(data) { - const scene = this.scene; - - if (scene?.sys?.settings?.key === 'game') { - scene.playerSpeed = 0; - scene.playerHull = 100; - scene.gameState = 'playing'; - scene.lastPlayerShot = 0; - scene.wave = 1; - scene.defeated = 0; - } - - return originalRestart.call(this, data); -}; - -const originalSetData = Phaser.GameObjects.GameObject.prototype.setData; -Phaser.GameObjects.GameObject.prototype.setData = function setBalancedDamage(key, value) { - if (key === 'damage' && this.texture?.key === 'pirate-shot') { - value = Math.min(Number(value) || 0, 4); - } - - return originalSetData.call(this, key, value); -}; - -await import('./game-v4.js'); +import './game-v4.js';