From fa4793f5eb0299097b5f2297a5408c68299365f6 Mon Sep 17 00:00:00 2001 From: ntr Date: Tue, 27 Nov 2018 23:40:47 +1100 Subject: [PATCH 1/3] rename skills -> animations --- ...{combat.skills.js => combat.animations.js} | 0 .../src/scenes/combat.render.resolutions.js | 20 +++++++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) rename client/src/scenes/{combat.skills.js => combat.animations.js} (100%) diff --git a/client/src/scenes/combat.skills.js b/client/src/scenes/combat.animations.js similarity index 100% rename from client/src/scenes/combat.skills.js rename to client/src/scenes/combat.animations.js diff --git a/client/src/scenes/combat.render.resolutions.js b/client/src/scenes/combat.render.resolutions.js index ea0bd496..80d1b07b 100644 --- a/client/src/scenes/combat.render.resolutions.js +++ b/client/src/scenes/combat.render.resolutions.js @@ -1,15 +1,15 @@ const { eachSeries } = require('async'); -const CombatSkills = require('./combat.skills'); +const CombatAnimations = require('./combat.animations'); const { CrypImage } = require('./combat.cryps'); const { DELAYS: { ANIMATION_DURATION, MOVE_CREEP, DAMAGE_TICK }, POSITIONS: { COMBAT }, } = require('./constants'); -const randomSkill = () => { - const skills = ['wall', 'spit', 'gravBlast', 'gravBomb', 'chargeBall']; - return skills[Math.floor(Math.random() * 5)]; +const randomAnimation = () => { + const animations = ['wall', 'spit', 'gravBlast', 'gravBomb', 'chargeBall']; + return animations[Math.floor(Math.random() * 5)]; }; function findResolutionCryps(scene, group, resolution, allyTeam, enemyTeam) { @@ -32,7 +32,7 @@ function findResolutionCryps(scene, group, resolution, allyTeam, enemyTeam) { } function animatePhase(scene, group, game, resolution, cb) { - scene.skills = new CombatSkills(scene); + const animations = new CombatAnimations(scene); // Find cryps and targets const tweenParams = (targets, centreSpot, enemy) => { @@ -60,11 +60,11 @@ function animatePhase(scene, group, game, resolution, cb) { scene.tweens.add(moveAllyBattle); scene.tweens.add(moveEnemyBattle); - // animate skill - const skill = randomSkill(); + // animate animation + const animation = randomAnimation(); scene.time.delayedCall(MOVE_CREEP, () => { const isAlly = resolution.target_team_id === account.id; - scene.skills[skill](isAlly); + animations[animation](isAlly); // Target cryp takes damage scene.time.delayedCall(ANIMATION_DURATION, () => { @@ -77,8 +77,8 @@ function animatePhase(scene, group, game, resolution, cb) { // all done scene.time.delayedCall(MOVE_CREEP, () => { - scene.skills.cleanup(); - scene.skills.destroy(); + animations.cleanup(); + animations.destroy(); return cb(); }); }); From e6e93b776ed17cf8d0d7092e5ad3e25743fde6c5 Mon Sep 17 00:00:00 2001 From: ntr Date: Tue, 27 Nov 2018 23:57:13 +1100 Subject: [PATCH 2/3] line endings =" --- client/src/scenes/combat.animations.js | 312 ++++++++++++------------- client/src/scenes/combat.js | 228 +++++++++--------- 2 files changed, 270 insertions(+), 270 deletions(-) diff --git a/client/src/scenes/combat.animations.js b/client/src/scenes/combat.animations.js index 477d2e8c..fdb385a7 100644 --- a/client/src/scenes/combat.animations.js +++ b/client/src/scenes/combat.animations.js @@ -1,156 +1,156 @@ -const Phaser = require('phaser'); -const { POSITIONS: { COMBAT }, DELAYS } = require('./constants'); - -const randomColour = () => { - const colours = ['green', 'blue', 'red', 'white', 'yellow']; - return colours[Math.floor(Math.random() * 5)]; -}; - -const animationParams = (isAlly) => { - const spawnLocation = isAlly ? COMBAT.width() * 0.35 : COMBAT.width() * 0.65; - const speed = isAlly ? 250 : -250; - const img = randomColour(); - const angleMin = isAlly ? 320 : 180; - const angleMax = isAlly ? 360 : 220; - return { spawnLocation, speed, img, angleMin, angleMax }; -}; - -class CombatSkills extends Phaser.GameObjects.Group { - constructor(scene) { - super(scene); - this.scene = scene; - } - - wall(isAlly) { - const lifespan = DELAYS.EFFECT_DURATION; - const { spawnLocation, speed, img } = animationParams(isAlly); - const particles = this.scene.add.particles(img); - const emitter = particles.createEmitter({ - x: spawnLocation, - y: { min: COMBAT.height() * 0.2, max: COMBAT.height() * 0.5 }, - speedX: { min: speed, max: speed * 2 }, - scale: { start: 0.4, end: 0 }, - quantity: 4, - blendMode: 'ADD', - lifespan, - }); - this.add(particles); - this.scene.time.delayedCall(lifespan, () => { emitter.stop(); }, [], this.scene); - } - - spit(isAlly) { - const lifespan = DELAYS.EFFECT_DURATION; - const { spawnLocation, speed, img, angleMin, angleMax } = animationParams(isAlly); - const particles = this.scene.add.particles(img); - const emitter = particles.createEmitter({ - x: spawnLocation, - y: COMBAT.height() * 0.35, - angle: { min: angleMin, max: angleMax }, - speed: speed * 2, - scale: { start: 0.4, end: 1 }, - gravityY: 250, - quantity: 4, - blendMode: 'ADD', - lifespan, - }); - this.add(particles); - this.scene.time.delayedCall(lifespan, () => { emitter.stop(); }, [], this); - } - - gravBomb(isAlly) { - const lifespan = DELAYS.EFFECT_DURATION; - - const { spawnLocation, img } = animationParams(isAlly); - const particles = this.scene.add.particles(img); - const location = isAlly ? COMBAT.width() * 0.35 : COMBAT.width() * 0.65; - const well = particles.createGravityWell({ - x: location, - y: COMBAT.height() * 0.25, - power: 4, - gravity: 500, - }); - this.emitter = particles.createEmitter({ - x: spawnLocation, - y: COMBAT.height() * 0.25, - speed: 1000, - scale: { start: 0.7, end: 1 }, - blendMode: 'ADD', - lifespan, - }); - this.add(particles); - this.scene.time.delayedCall(lifespan, () => { this.emitter.stop(); well.active = false; }, [], this.scene); - } - - gravBlast(isAlly) { - const lifespan = DELAYS.EFFECT_DURATION; - const WELL_END = lifespan / 2; - - const img = randomColour(); - const spawnLocation = isAlly ? COMBAT.width() * 0.35 : COMBAT.width() * 0.65; - const isEnemyLocation = isAlly ? COMBAT.width() * 0.7 : COMBAT.width() * 0.3; - const particles = this.scene.add.particles(img); - const bounds = isAlly - ? { x: COMBAT.width() * 0.3, y: COMBAT.height() * 0.2, w: COMBAT.width() * 0.5, h: COMBAT.height() * 0.2 } - : { x: 0.2 * COMBAT.width(), y: COMBAT.height() * 0.2, w: COMBAT.width() * 0.5, h: COMBAT.height() * 0.2 }; - const well = particles.createGravityWell({ - x: spawnLocation, - y: COMBAT.height() * 0.35, - power: 4, - gravity: 500, - }); - const emitter = particles.createEmitter({ - x: spawnLocation, - y: COMBAT.height() * 0.35, - speed: 1000, - scale: { start: 0.7, end: 1 }, - blendMode: 'ADD', - bounds, - lifespan, - }); - this.add(particles); - this.scene.time.delayedCall(WELL_END, () => { emitter.stop(); well.x = isEnemyLocation; }, [], this.scene); - this.scene.time.delayedCall(lifespan, () => { well.active = false; }, [], this.scene); - } - - chargeBall(isAlly) { - const lifespan = DELAYS.EFFECT_DURATION; - const CHARGE_LIFESPAN = lifespan / 2; - - const { img, spawnLocation } = animationParams(isAlly); - const targetLocation = isAlly ? 0.7 * COMBAT.width() : 0.25 * COMBAT.width(); - const particles = this.scene.add.particles(img); - const emitter = particles.createEmitter({ - x: 0, - y: 0, - moveToX: spawnLocation, - moveToY: COMBAT.height() * 0.1, - scale: 0.75, - quantity: 4, - _frequency: 20, - blendMode: 'ADD', - emitZone: { source: new Phaser.Geom.Rectangle(0, 0, COMBAT.width(), COMBAT.height()) }, - lifespan: CHARGE_LIFESPAN, - }); - const emitter2 = particles.createEmitter({ - radial: false, - x: { min: spawnLocation, max: targetLocation, steps: 256 }, - y: { min: COMBAT.height() * 0.1, max: COMBAT.height() * 0.4, steps: 256 }, - quantity: 4, - gravityY: 0, - scale: { start: 1.5, end: 0, ease: 'Power3' }, - blendMode: 'ADD', - active: false, - lifespan, - }); - this.add(particles); - this.scene.time.delayedCall(CHARGE_LIFESPAN, () => { emitter.stop(); }, [], this.scene); - this.scene.time.delayedCall(CHARGE_LIFESPAN, () => { emitter2.active = true; }, [], this.scene); - this.scene.time.delayedCall(lifespan, () => { emitter2.stop(); }, [], this.scene); - } - - cleanup() { - this.children.entries.forEach(obj => obj.destroy()); - } -} - -module.exports = CombatSkills; +const Phaser = require('phaser'); +const { POSITIONS: { COMBAT }, DELAYS } = require('./constants'); + +const randomColour = () => { + const colours = ['green', 'blue', 'red', 'white', 'yellow']; + return colours[Math.floor(Math.random() * 5)]; +}; + +const animationParams = (isAlly) => { + const spawnLocation = isAlly ? COMBAT.width() * 0.35 : COMBAT.width() * 0.65; + const speed = isAlly ? 250 : -250; + const img = randomColour(); + const angleMin = isAlly ? 320 : 180; + const angleMax = isAlly ? 360 : 220; + return { spawnLocation, speed, img, angleMin, angleMax }; +}; + +class CombatSkills extends Phaser.GameObjects.Group { + constructor(scene) { + super(scene); + this.scene = scene; + } + + wall(isAlly) { + const lifespan = DELAYS.EFFECT_DURATION; + const { spawnLocation, speed, img } = animationParams(isAlly); + const particles = this.scene.add.particles(img); + const emitter = particles.createEmitter({ + x: spawnLocation, + y: { min: COMBAT.height() * 0.2, max: COMBAT.height() * 0.5 }, + speedX: { min: speed, max: speed * 2 }, + scale: { start: 0.4, end: 0 }, + quantity: 4, + blendMode: 'ADD', + lifespan, + }); + this.add(particles); + this.scene.time.delayedCall(lifespan, () => { emitter.stop(); }, [], this.scene); + } + + spit(isAlly) { + const lifespan = DELAYS.EFFECT_DURATION; + const { spawnLocation, speed, img, angleMin, angleMax } = animationParams(isAlly); + const particles = this.scene.add.particles(img); + const emitter = particles.createEmitter({ + x: spawnLocation, + y: COMBAT.height() * 0.35, + angle: { min: angleMin, max: angleMax }, + speed: speed * 2, + scale: { start: 0.4, end: 1 }, + gravityY: 25, + quantity: 4, + blendMode: 'ADD', + lifespan, + }); + this.add(particles); + this.scene.time.delayedCall(lifespan, () => { emitter.stop(); }, [], this); + } + + gravBomb(isAlly) { + const lifespan = DELAYS.EFFECT_DURATION; + + const { spawnLocation, img } = animationParams(isAlly); + const particles = this.scene.add.particles(img); + const location = isAlly ? COMBAT.width() * 0.35 : COMBAT.width() * 0.65; + const well = particles.createGravityWell({ + x: location, + y: COMBAT.height() * 0.25, + power: 4, + gravity: 500, + }); + this.emitter = particles.createEmitter({ + x: spawnLocation, + y: COMBAT.height() * 0.25, + speed: 1000, + scale: { start: 0.7, end: 1 }, + blendMode: 'ADD', + lifespan, + }); + this.add(particles); + this.scene.time.delayedCall(lifespan, () => { this.emitter.stop(); well.active = false; }, [], this.scene); + } + + gravBlast(isAlly) { + const lifespan = DELAYS.EFFECT_DURATION; + const WELL_END = lifespan / 2; + + const img = randomColour(); + const spawnLocation = isAlly ? COMBAT.width() * 0.35 : COMBAT.width() * 0.65; + const isEnemyLocation = isAlly ? COMBAT.width() * 0.7 : COMBAT.width() * 0.3; + const particles = this.scene.add.particles(img); + const bounds = isAlly + ? { x: COMBAT.width() * 0.3, y: COMBAT.height() * 0.2, w: COMBAT.width() * 0.5, h: COMBAT.height() * 0.2 } + : { x: 0.2 * COMBAT.width(), y: COMBAT.height() * 0.2, w: COMBAT.width() * 0.5, h: COMBAT.height() * 0.2 }; + const well = particles.createGravityWell({ + x: spawnLocation, + y: COMBAT.height() * 0.35, + power: 4, + gravity: 500, + }); + const emitter = particles.createEmitter({ + x: spawnLocation, + y: COMBAT.height() * 0.35, + speed: 1000, + scale: { start: 0.7, end: 1 }, + blendMode: 'ADD', + bounds, + lifespan, + }); + this.add(particles); + this.scene.time.delayedCall(WELL_END, () => { emitter.stop(); well.x = isEnemyLocation; }, [], this.scene); + this.scene.time.delayedCall(lifespan, () => { well.active = false; }, [], this.scene); + } + + chargeBall(isAlly) { + const lifespan = DELAYS.EFFECT_DURATION; + const CHARGE_LIFESPAN = lifespan / 2; + + const { img, spawnLocation } = animationParams(isAlly); + const targetLocation = isAlly ? 0.7 * COMBAT.width() : 0.25 * COMBAT.width(); + const particles = this.scene.add.particles(img); + const emitter = particles.createEmitter({ + x: 0, + y: 0, + moveToX: spawnLocation, + moveToY: COMBAT.height() * 0.1, + scale: 0.75, + quantity: 4, + _frequency: 20, + blendMode: 'ADD', + emitZone: { source: new Phaser.Geom.Rectangle(0, 0, COMBAT.width(), COMBAT.height()) }, + lifespan: CHARGE_LIFESPAN, + }); + const emitter2 = particles.createEmitter({ + radial: false, + x: { min: spawnLocation, max: targetLocation, steps: 256 }, + y: { min: COMBAT.height() * 0.1, max: COMBAT.height() * 0.4, steps: 256 }, + quantity: 4, + gravityY: 0, + scale: { start: 1.5, end: 0, ease: 'Power3' }, + blendMode: 'ADD', + active: false, + lifespan, + }); + this.add(particles); + this.scene.time.delayedCall(CHARGE_LIFESPAN, () => { emitter.stop(); }, [], this.scene); + this.scene.time.delayedCall(CHARGE_LIFESPAN, () => { emitter2.active = true; }, [], this.scene); + this.scene.time.delayedCall(lifespan, () => { emitter2.stop(); }, [], this.scene); + } + + cleanup() { + this.children.entries.forEach(obj => obj.destroy()); + } +} + +module.exports = CombatSkills; diff --git a/client/src/scenes/combat.js b/client/src/scenes/combat.js index 6c2ee8d2..34fb670c 100644 --- a/client/src/scenes/combat.js +++ b/client/src/scenes/combat.js @@ -1,114 +1,114 @@ -const Phaser = require('phaser'); -const fs = require('fs'); - -const { POSITIONS: { COMBAT }, TEXT } = require('./constants'); -const { DrawCrypTeams, CrypImage, CrypSkill } = require('./combat.cryps'); -const renderResolutions = require('./combat.render.resolutions'); - -const CRYP_KEY_MAP = ['keydown_ONE', 'keydown_TWO', 'keydown_THREE']; -const SKILL_KEY_MAP = ['keydown_Q', 'keydown_W', 'keydown_E', 'keydown_R']; - - -class Combat extends Phaser.Scene { - constructor() { - super({ key: 'Combat' }); - } - - preload() { - /* Static Images */ - this.textures.addBase64('alk', `data:image/png;base64,${new Buffer.from(fs.readFileSync('./assets/alakazam-f.png')).toString('base64')}`); - this.textures.addBase64('magmar', `data:image/png;base64,${new Buffer.from(fs.readFileSync('./assets/magmar.png')).toString('base64')}`); - this.load.image('proj', 'http://labs.phaser.io/assets/sprites/bullet.png'); - this.load.image('blue', 'http://labs.phaser.io/assets/particles/blue.png'); - this.load.image('green', 'http://labs.phaser.io/assets/particles/green.png'); - this.load.image('red', 'http://labs.phaser.io/assets/particles/red.png'); - this.load.image('white', 'http://labs.phaser.io/assets/particles/white.png'); - this.load.image('yellow', 'http://labs.phaser.io/assets/particles/yellow.png'); - } - - create() { - this.registry.events.on('changedata', this.updateData, this); - this.input.keyboard.on('keydown_S', () => { - this.scene.switch('CrypList'); // Switch back to cryp list - }, 0, this); - - this.input.on('pointerup', (pointer, obj) => { - if (obj[0] instanceof CrypImage || obj[0] instanceof CrypSkill) { - obj[0].clickHandler(); - } else if (this.registry.get('activeSkill')) { - this.registry.get('activeSkill').clearTint(); - this.registry.set('activeSkill', null); - } - }); - - const logX = COMBAT.LOG.x(); - const logY = COMBAT.LOG.y(); - const logWidth = COMBAT.LOG.width(); - // this.skills = new CombatSkills(this); - this.renderedResolves = 0; - - this.registry.set('gameAnimating', false); - this.account = this.registry.get('account'); - this.log = this.add.text(COMBAT.LOG.x(), COMBAT.LOG.y(), '', TEXT.NORMAL); - this.log.setWordWrapWidth(COMBAT.LOG.width()); - return true; - } - - updateData(parent, key, data) { - if (key === 'game') { - this.redrawGame(data); - } - return true; - } - - redrawGame(game) { - if (!game) return false; - - const updatedNeeded = !this.registry.get('activeSkill') && !this.registry.get('gameAnimating'); - if (!updatedNeeded) return false; - - // do we need to render resolution animations? - if (game.resolved.length !== this.renderedResolves) { - const newResolutions = game.resolved.slice(this.renderedResolves); - renderResolutions(this, game, this.crypTeamRender, newResolutions); - this.renderedResolves = game.resolved.length; - return true; - } - - // If not animating resolutions render static skill / block phase - if (this.crypTeamRender) this.crypTeamRender.destroy(true); - this.crypTeamRender = new DrawCrypTeams(this, game); - - // update log - // shallow copy because reverse mutates - this.log.setText(Array.from(game.log).slice(0, this.logIter).reverse()); - - return true; - } - - iterateLog(game) { - this.logIter += 1; - this.renderedResolves += 1; - this.log.setText(Array.from(game.log).slice(0, this.logIter).reverse()); - return this.resolvedIter === game.resolved.length; - } - - crypKeyHandler(cryp, iter) { - if (CRYP_KEY_MAP[iter]) { - this.input.keyboard.removeListener(CRYP_KEY_MAP[iter]); - if (cryp.skills.length > 0) { // check there are cryp skills - this.input.keyboard.on(CRYP_KEY_MAP[iter], () => { - SKILL_KEY_MAP.forEach(k => this.input.keyboard.removeListener(k)); - cryp.skills.forEach((skill, i) => { - this.input.keyboard.on(SKILL_KEY_MAP[i], () => { - this.game.events.emit('SET_ACTIVE_SKILL', skill); - skill.setActive(); - }, this); - }); - }, this); - } - } - } -} - -module.exports = Combat; +const Phaser = require('phaser'); +const fs = require('fs'); + +const { POSITIONS: { COMBAT }, TEXT } = require('./constants'); +const { DrawCrypTeams, CrypImage, CrypSkill } = require('./combat.cryps'); +const renderResolutions = require('./combat.render.resolutions'); + +const CRYP_KEY_MAP = ['keydown_ONE', 'keydown_TWO', 'keydown_THREE']; +const SKILL_KEY_MAP = ['keydown_Q', 'keydown_W', 'keydown_E', 'keydown_R']; + + +class Combat extends Phaser.Scene { + constructor() { + super({ key: 'Combat' }); + } + + preload() { + /* Static Images */ + this.textures.addBase64('alk', `data:image/png;base64,${new Buffer.from(fs.readFileSync('./assets/alakazam-f.png')).toString('base64')}`); + this.textures.addBase64('magmar', `data:image/png;base64,${new Buffer.from(fs.readFileSync('./assets/magmar.png')).toString('base64')}`); + this.load.image('proj', 'http://labs.phaser.io/assets/sprites/bullet.png'); + this.load.image('blue', 'http://labs.phaser.io/assets/particles/blue.png'); + this.load.image('green', 'http://labs.phaser.io/assets/particles/green.png'); + this.load.image('red', 'http://labs.phaser.io/assets/particles/red.png'); + this.load.image('white', 'http://labs.phaser.io/assets/particles/white.png'); + this.load.image('yellow', 'http://labs.phaser.io/assets/particles/yellow.png'); + } + + create() { + this.registry.events.on('changedata', this.updateData, this); + this.input.keyboard.on('keydown_S', () => { + this.scene.switch('CrypList'); // Switch back to cryp list + }, 0, this); + + this.input.on('pointerup', (pointer, obj) => { + if (obj[0] instanceof CrypImage || obj[0] instanceof CrypSkill) { + obj[0].clickHandler(); + } else if (this.registry.get('activeSkill')) { + this.registry.get('activeSkill').clearTint(); + this.registry.set('activeSkill', null); + } + }); + + const logX = COMBAT.LOG.x(); + const logY = COMBAT.LOG.y(); + const logWidth = COMBAT.LOG.width(); + + this.renderedResolves = 0; + this.registry.set('gameAnimating', false); + + this.account = this.registry.get('account'); + this.log = this.add.text(COMBAT.LOG.x(), COMBAT.LOG.y(), '', TEXT.NORMAL); + this.log.setWordWrapWidth(COMBAT.LOG.width()); + return true; + } + + updateData(parent, key, data) { + if (key === 'game') { + this.redrawGame(data); + } + return true; + } + + redrawGame(game) { + if (!game) return false; + + const updatedNeeded = !this.registry.get('activeSkill') && !this.registry.get('gameAnimating'); + if (!updatedNeeded) return false; + + // do we need to render resolution animations? + if (game.resolved.length !== this.renderedResolves) { + const newResolutions = game.resolved.slice(this.renderedResolves); + renderResolutions(this, game, this.crypTeamRender, newResolutions); + this.renderedResolves = game.resolved.length; + return true; + } + + // If not animating resolutions render static skill / block phase + if (this.crypTeamRender) this.crypTeamRender.destroy(true); + this.crypTeamRender = new DrawCrypTeams(this, game); + + // update log + // shallow copy because reverse mutates + this.log.setText(Array.from(game.log).slice(0, this.logIter).reverse()); + + return true; + } + + iterateLog(game) { + this.logIter += 1; + this.renderedResolves += 1; + this.log.setText(Array.from(game.log).slice(0, this.logIter).reverse()); + return this.resolvedIter === game.resolved.length; + } + + crypKeyHandler(cryp, iter) { + if (CRYP_KEY_MAP[iter]) { + this.input.keyboard.removeListener(CRYP_KEY_MAP[iter]); + if (cryp.skills.length > 0) { // check there are cryp skills + this.input.keyboard.on(CRYP_KEY_MAP[iter], () => { + SKILL_KEY_MAP.forEach(k => this.input.keyboard.removeListener(k)); + cryp.skills.forEach((skill, i) => { + this.input.keyboard.on(SKILL_KEY_MAP[i], () => { + this.game.events.emit('SET_ACTIVE_SKILL', skill); + skill.setActive(); + }, this); + }); + }, this); + } + } + } +} + +module.exports = Combat; From 9f4f9c96be84a37f4efa547d4bb267cac84b6ff9 Mon Sep 17 00:00:00 2001 From: ntr Date: Wed, 28 Nov 2018 00:03:40 +1100 Subject: [PATCH 3/3] hurrrrrrr --- client/src/scenes/combat.animations.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/scenes/combat.animations.js b/client/src/scenes/combat.animations.js index fdb385a7..89be843e 100644 --- a/client/src/scenes/combat.animations.js +++ b/client/src/scenes/combat.animations.js @@ -22,7 +22,7 @@ class CombatSkills extends Phaser.GameObjects.Group { } wall(isAlly) { - const lifespan = DELAYS.EFFECT_DURATION; + const lifespan = DELAYS.ANIMATION_DURATION; const { spawnLocation, speed, img } = animationParams(isAlly); const particles = this.scene.add.particles(img); const emitter = particles.createEmitter({ @@ -39,7 +39,7 @@ class CombatSkills extends Phaser.GameObjects.Group { } spit(isAlly) { - const lifespan = DELAYS.EFFECT_DURATION; + const lifespan = DELAYS.ANIMATION_DURATION; const { spawnLocation, speed, img, angleMin, angleMax } = animationParams(isAlly); const particles = this.scene.add.particles(img); const emitter = particles.createEmitter({ @@ -58,7 +58,7 @@ class CombatSkills extends Phaser.GameObjects.Group { } gravBomb(isAlly) { - const lifespan = DELAYS.EFFECT_DURATION; + const lifespan = DELAYS.ANIMATION_DURATION; const { spawnLocation, img } = animationParams(isAlly); const particles = this.scene.add.particles(img); @@ -82,7 +82,7 @@ class CombatSkills extends Phaser.GameObjects.Group { } gravBlast(isAlly) { - const lifespan = DELAYS.EFFECT_DURATION; + const lifespan = DELAYS.ANIMATION_DURATION; const WELL_END = lifespan / 2; const img = randomColour(); @@ -113,7 +113,7 @@ class CombatSkills extends Phaser.GameObjects.Group { } chargeBall(isAlly) { - const lifespan = DELAYS.EFFECT_DURATION; + const lifespan = DELAYS.ANIMATION_DURATION; const CHARGE_LIFESPAN = lifespan / 2; const { img, spawnLocation } = animationParams(isAlly);