Compare commits

..

2 Commits
main ... dev

Author SHA1 Message Date
faafc1e015 finale 2025-04-26 22:40:25 +02:00
e57c80c623 minor changes 2025-04-23 20:34:23 +02:00
7 changed files with 12 additions and 40 deletions

View File

@ -1,20 +0,0 @@
const fs = require('fs');
const { exec, execSync } = require('child_process');
let dir = fs.readdirSync('.');
// dir.forEach((item) => {
// const itemPath = `./${item}`;
// if (fs.lstatSync(itemPath).isDirectory()) {
// let subDir = fs.readdirSync(itemPath);
// subDir.forEach(async (subItem) => {
// const subItemPath = `${itemPath}/${subItem}`;
// if (fs.lstatSync(subItemPath).isFile() && subItem.endsWith('.png')) {
// const outputFilePath = `${itemPath}/${subItem.replace('.png', 's.png')}`;
// await execSync(`convert -resize 128x128 -quality 80 ${subItemPath} ${outputFilePath}`);
// fs.unlinkSync(subItemPath);
// fs.renameSync(outputFilePath, subItemPath);
// }
// });
// }
// });
// Disabled for now, dont need to optimize assets.

View File

@ -86,11 +86,11 @@
"speed": 3,
"special": null,
"resistance": {
"physical": 1,
"divine": -0.25,
"fire": 1,
"ice": 1,
"frostfire": 1
"physical": 0,
"divine": 0,
"fire": 0,
"ice": 0,
"frostfire": 0
}
}
},

View File

@ -224,14 +224,6 @@ export default class Creep extends GameObject {
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() {
super.destroy();
this.container.removeChildren();

View File

@ -146,7 +146,7 @@ export class Grid extends GameObject {
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);
for (let y = 0; y < this.gameMap.columns; y++) {

View File

@ -62,7 +62,7 @@ export default class MissionStats extends GameObject {
this.inventory.push(gem);
if (!noNotify)
Engine.NotificationManager.Notify(
`Lv. ${gem.level} ${gem.definition.name}` + ' added to your inventory.',
`Lv. ${gem.level} ${gem.definition.name} added to your inventory.`,
'gemaward'
);
Engine.GameScene.events.emit(StatsEvents.GemGivenEvent, gem);

View File

@ -6,7 +6,6 @@ import { CreepEvents } from '../Events';
import { distance, Tower } from './Tower';
import { CreepResistancesDefinition } from '../Definitions';
import GameAssets from '../Assets';
import { RoundMode } from '../../scenes/Game';
export function calculateAngleToPoint(x, y, targetX, targetY) {
const dx = targetX - x;
@ -47,6 +46,7 @@ export default class Projectile extends GameObject {
this.gemResistanceModifications = gemResistanceModifications;
this.sprite = new PIXI.AnimatedSprite({ textures: textures, scale: 0.25, rotation: angle });
this.sprite.anchor.set(0.5, 0.5);
// this.sprite.tint = tint;
this.sprite.play();
this.container.x = this.x;
this.container.y = this.y;
@ -71,7 +71,7 @@ export default class Projectile extends GameObject {
Engine.Grid.creeps.forEach((creep) => {
if (this.pierce <= 0) return;
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) {
this.collidedCreepIDs.push(creep);
this.pierce--;
@ -100,8 +100,8 @@ export default class Projectile extends GameObject {
public checkCollision(creep: Creep) {
//console.debug(creep);
if (creep == null || creep.container == null || creep.container._position == null) return;
let mybb = this.copyContainerToBB();
let otherbb = creep.copyContainerToBB();
const mybb = this.copyContainerToBB();
const otherbb = creep.copyContainerToBB();
return mybb.getBounds().intersects(otherbb.getBounds());
}
}

View File

@ -178,7 +178,7 @@ export default class Tooltip extends GuiObject {
this.gemAmount.alpha = 0;
this.gemDescriptionText.alpha = 1;
this.titleText.text = `Lv. ${gem.level} ` + gem.definition.name;
this.titleText.text = `Lv. ${gem.level} ${gem.definition.name}`;
let costToLevelUp;
if (!gem.isMaxLevel())
costToLevelUp = `Costs ${gem.definition.genericImprovements[gem.level].gemValueUp} gold to level up.`;