minor changes
This commit is contained in:
parent
185faa42e2
commit
e57c80c623
@ -224,14 +224,6 @@ export default class Creep extends GameObject {
|
|||||||
this.container.y = this.y;
|
this.container.y = this.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public takeDamage(amount: number) {
|
|
||||||
// this.health -= amount;
|
|
||||||
// if (this.health < 0 && !this.died) {
|
|
||||||
// this.died = true;
|
|
||||||
// this.events.emit(CreepEvents.Died, this);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
public destroy() {
|
public destroy() {
|
||||||
super.destroy();
|
super.destroy();
|
||||||
this.container.removeChildren();
|
this.container.removeChildren();
|
||||||
|
@ -146,7 +146,7 @@ export class Grid extends GameObject {
|
|||||||
|
|
||||||
Engine.GameMaster.currentScene.stage.addChild(this.container);
|
Engine.GameMaster.currentScene.stage.addChild(this.container);
|
||||||
|
|
||||||
let background = new PIXI.Sprite(GameAssets.MissionBackgrounds[missionIndex]);
|
const background = new PIXI.Sprite(GameAssets.MissionBackgrounds[missionIndex]);
|
||||||
this.container.addChild(background);
|
this.container.addChild(background);
|
||||||
|
|
||||||
for (let y = 0; y < this.gameMap.columns; y++) {
|
for (let y = 0; y < this.gameMap.columns; y++) {
|
||||||
|
@ -62,7 +62,7 @@ export default class MissionStats extends GameObject {
|
|||||||
this.inventory.push(gem);
|
this.inventory.push(gem);
|
||||||
if (!noNotify)
|
if (!noNotify)
|
||||||
Engine.NotificationManager.Notify(
|
Engine.NotificationManager.Notify(
|
||||||
`Lv. ${gem.level} ${gem.definition.name}` + ' added to your inventory.',
|
`Lv. ${gem.level} ${gem.definition.name} added to your inventory.`,
|
||||||
'gemaward'
|
'gemaward'
|
||||||
);
|
);
|
||||||
Engine.GameScene.events.emit(StatsEvents.GemGivenEvent, gem);
|
Engine.GameScene.events.emit(StatsEvents.GemGivenEvent, gem);
|
||||||
|
@ -6,7 +6,6 @@ import { CreepEvents } from '../Events';
|
|||||||
import { distance, Tower } from './Tower';
|
import { distance, Tower } from './Tower';
|
||||||
import { CreepResistancesDefinition } from '../Definitions';
|
import { CreepResistancesDefinition } from '../Definitions';
|
||||||
import GameAssets from '../Assets';
|
import GameAssets from '../Assets';
|
||||||
import { RoundMode } from '../../scenes/Game';
|
|
||||||
|
|
||||||
export function calculateAngleToPoint(x, y, targetX, targetY) {
|
export function calculateAngleToPoint(x, y, targetX, targetY) {
|
||||||
const dx = targetX - x;
|
const dx = targetX - x;
|
||||||
@ -47,6 +46,7 @@ export default class Projectile extends GameObject {
|
|||||||
this.gemResistanceModifications = gemResistanceModifications;
|
this.gemResistanceModifications = gemResistanceModifications;
|
||||||
this.sprite = new PIXI.AnimatedSprite({ textures: textures, scale: 0.25, rotation: angle });
|
this.sprite = new PIXI.AnimatedSprite({ textures: textures, scale: 0.25, rotation: angle });
|
||||||
this.sprite.anchor.set(0.5, 0.5);
|
this.sprite.anchor.set(0.5, 0.5);
|
||||||
|
// this.sprite.tint = tint;
|
||||||
this.sprite.play();
|
this.sprite.play();
|
||||||
this.container.x = this.x;
|
this.container.x = this.x;
|
||||||
this.container.y = this.y;
|
this.container.y = this.y;
|
||||||
@ -71,7 +71,7 @@ export default class Projectile extends GameObject {
|
|||||||
Engine.Grid.creeps.forEach((creep) => {
|
Engine.Grid.creeps.forEach((creep) => {
|
||||||
if (this.pierce <= 0) return;
|
if (this.pierce <= 0) return;
|
||||||
if (creep && creep.container && this.checkCollision(creep)) {
|
if (creep && creep.container && this.checkCollision(creep)) {
|
||||||
let exists = this.collidedCreepIDs.find((c) => creep.id == c.id);
|
const exists = this.collidedCreepIDs.find((c) => creep.id == c.id);
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
this.collidedCreepIDs.push(creep);
|
this.collidedCreepIDs.push(creep);
|
||||||
this.pierce--;
|
this.pierce--;
|
||||||
@ -100,8 +100,8 @@ export default class Projectile extends GameObject {
|
|||||||
public checkCollision(creep: Creep) {
|
public checkCollision(creep: Creep) {
|
||||||
//console.debug(creep);
|
//console.debug(creep);
|
||||||
if (creep == null || creep.container == null || creep.container._position == null) return;
|
if (creep == null || creep.container == null || creep.container._position == null) return;
|
||||||
let mybb = this.copyContainerToBB();
|
const mybb = this.copyContainerToBB();
|
||||||
let otherbb = creep.copyContainerToBB();
|
const otherbb = creep.copyContainerToBB();
|
||||||
return mybb.getBounds().intersects(otherbb.getBounds());
|
return mybb.getBounds().intersects(otherbb.getBounds());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ export default class Tooltip extends GuiObject {
|
|||||||
this.gemAmount.alpha = 0;
|
this.gemAmount.alpha = 0;
|
||||||
this.gemDescriptionText.alpha = 1;
|
this.gemDescriptionText.alpha = 1;
|
||||||
|
|
||||||
this.titleText.text = `Lv. ${gem.level} ` + gem.definition.name;
|
this.titleText.text = `Lv. ${gem.level} ${gem.definition.name}`;
|
||||||
let costToLevelUp;
|
let costToLevelUp;
|
||||||
if (!gem.isMaxLevel())
|
if (!gem.isMaxLevel())
|
||||||
costToLevelUp = `Costs ${gem.definition.genericImprovements[gem.level].gemValueUp} gold to level up.`;
|
costToLevelUp = `Costs ${gem.definition.genericImprovements[gem.level].gemValueUp} gold to level up.`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user