creeps load as spritesheets now
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 13 KiB |
BIN
public/assets/creeps/demon/spritesheet.png
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
public/assets/creeps/hood/spritesheet.png
Normal file
After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
@ -1,18 +1,20 @@
|
|||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const { exec, execSync } = require('child_process');
|
const { exec, execSync } = require('child_process');
|
||||||
let dir = fs.readdirSync('.');
|
let dir = fs.readdirSync('.');
|
||||||
dir.forEach((item) => {
|
// dir.forEach((item) => {
|
||||||
const itemPath = `./${item}`;
|
// const itemPath = `./${item}`;
|
||||||
if (fs.lstatSync(itemPath).isDirectory()) {
|
// if (fs.lstatSync(itemPath).isDirectory()) {
|
||||||
let subDir = fs.readdirSync(itemPath);
|
// let subDir = fs.readdirSync(itemPath);
|
||||||
subDir.forEach(async (subItem) => {
|
// subDir.forEach(async (subItem) => {
|
||||||
const subItemPath = `${itemPath}/${subItem}`;
|
// const subItemPath = `${itemPath}/${subItem}`;
|
||||||
if (fs.lstatSync(subItemPath).isFile() && subItem.endsWith('.png')) {
|
// if (fs.lstatSync(subItemPath).isFile() && subItem.endsWith('.png')) {
|
||||||
const outputFilePath = `${itemPath}/${subItem.replace('.png', 's.png')}`;
|
// const outputFilePath = `${itemPath}/${subItem.replace('.png', 's.png')}`;
|
||||||
await execSync(`convert -resize 128x128 -quality 80 ${subItemPath} ${outputFilePath}`);
|
// await execSync(`convert -resize 128x128 -quality 80 ${subItemPath} ${outputFilePath}`);
|
||||||
fs.unlinkSync(subItemPath);
|
// fs.unlinkSync(subItemPath);
|
||||||
fs.renameSync(outputFilePath, subItemPath);
|
// fs.renameSync(outputFilePath, subItemPath);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
// Disabled for now, dont need to optimize assets.
|
||||||
|
BIN
public/assets/creeps/pumpkin/spritesheet.png
Normal file
After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 14 KiB |
BIN
public/assets/creeps/skeleton/spritesheet.png
Normal file
After Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
BIN
public/assets/creeps/wood/spritesheet.png
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
public/assets/creeps/zombie/spritesheet.png
Normal file
After Width: | Height: | Size: 97 KiB |
@ -1,6 +1,7 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "basic",
|
"name": "basic",
|
||||||
|
"sprite": "wood",
|
||||||
"textures": [],
|
"textures": [],
|
||||||
"textureArrayLength": 12,
|
"textureArrayLength": 12,
|
||||||
"stats": {
|
"stats": {
|
||||||
@ -18,6 +19,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "quick",
|
"name": "quick",
|
||||||
|
"sprite": "zombie",
|
||||||
"textures": [],
|
"textures": [],
|
||||||
"textureArrayLength": 8,
|
"textureArrayLength": 8,
|
||||||
"stats": {
|
"stats": {
|
||||||
@ -35,6 +37,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tank",
|
"name": "tank",
|
||||||
|
"sprite": "skeleton",
|
||||||
"textures": [],
|
"textures": [],
|
||||||
"textureArrayLength": 12,
|
"textureArrayLength": 12,
|
||||||
"stats": {
|
"stats": {
|
||||||
@ -52,6 +55,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "cloaker",
|
"name": "cloaker",
|
||||||
|
"sprite": "hood",
|
||||||
"textures": [],
|
"textures": [],
|
||||||
"textureArrayLength": 12,
|
"textureArrayLength": 12,
|
||||||
"stats": {
|
"stats": {
|
||||||
@ -69,6 +73,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "demon",
|
"name": "demon",
|
||||||
|
"sprite": "demon",
|
||||||
"textures": [],
|
"textures": [],
|
||||||
"textureArrayLength": 8,
|
"textureArrayLength": 8,
|
||||||
"stats": {
|
"stats": {
|
||||||
@ -86,6 +91,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "maker",
|
"name": "maker",
|
||||||
|
"sprite": "pumpkin",
|
||||||
"textures": [],
|
"textures": [],
|
||||||
"textureArrayLength": 11,
|
"textureArrayLength": 11,
|
||||||
"stats": {
|
"stats": {
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "Fire Gem",
|
"name": "Fire Gem",
|
||||||
"description": "Forged from molten lava, the Fire Gem imbues your tower's attacks and adds 50% extra fire damage. It can be merged with any gem and is common.",
|
"description": "Forged from molten lava, the Fire Gem imbues your tower's attacks and add extra fire damage. It can be merged with any gem and is common.",
|
||||||
"color": "red",
|
"color": "red",
|
||||||
"type": "Fire",
|
"type": "Fire",
|
||||||
"totalLevels": 9,
|
"totalLevels": 9,
|
||||||
"textures": [],
|
"textures": [],
|
||||||
"cantCombineWith": [],
|
"cantCombineWith": [],
|
||||||
"specialCombine": [],
|
"specialCombine": [],
|
||||||
"initialGemValue": 100,
|
"initialGemValue": 50,
|
||||||
"genericImprovements": [
|
"genericImprovements": [
|
||||||
{
|
{
|
||||||
"damageUp": 2,
|
"damageUp": 1,
|
||||||
"attackSpeedUp": 0,
|
"attackSpeedUp": 0,
|
||||||
"rangeUp": 0,
|
"rangeUp": 0,
|
||||||
"timeToLiveUp": 0,
|
"timeToLiveUp": 0,
|
||||||
"pierceUp": 1,
|
"pierceUp": 0,
|
||||||
"gemValueUp": 50
|
"gemValueUp": 50
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -548,7 +548,7 @@
|
|||||||
"textures": [],
|
"textures": [],
|
||||||
"cantCombineWith": [],
|
"cantCombineWith": [],
|
||||||
"specialCombine": [],
|
"specialCombine": [],
|
||||||
"initialGemValue": 200,
|
"initialGemValue": 250,
|
||||||
"genericImprovements": [
|
"genericImprovements": [
|
||||||
{
|
{
|
||||||
"damageUp": 0,
|
"damageUp": 0,
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
"projectile": "blue",
|
"projectile": "blue",
|
||||||
"projectileTextures": [],
|
"projectileTextures": [],
|
||||||
"projectileTexturesArrayLength": 4,
|
"projectileTexturesArrayLength": 4,
|
||||||
"description": "",
|
"description": "Doesn't shoot, instead buffs other towers with 50% of its power.",
|
||||||
"stats": {
|
"stats": {
|
||||||
"damage": 4,
|
"damage": 4,
|
||||||
"cooldown": 1000,
|
"cooldown": 1000,
|
||||||
@ -83,7 +83,7 @@
|
|||||||
"projectile": "white",
|
"projectile": "white",
|
||||||
"projectileTextures": [],
|
"projectileTextures": [],
|
||||||
"projectileTexturesArrayLength": 5,
|
"projectileTexturesArrayLength": 5,
|
||||||
"description": "",
|
"description": "Like a regular tower, just slows down creeps.",
|
||||||
"stats": {
|
"stats": {
|
||||||
"damage": 2,
|
"damage": 2,
|
||||||
"cooldown": 2000,
|
"cooldown": 2000,
|
||||||
@ -102,7 +102,7 @@
|
|||||||
"projectile": "red",
|
"projectile": "red",
|
||||||
"projectileTextures": [],
|
"projectileTextures": [],
|
||||||
"projectileTexturesArrayLength": 4,
|
"projectileTexturesArrayLength": 4,
|
||||||
"description": "If you feel a little circular.",
|
"description": "Shoots a quick, high pierce rail projectile at creeps.",
|
||||||
"stats": {
|
"stats": {
|
||||||
"damage": 2,
|
"damage": 2,
|
||||||
"cooldown": 2000,
|
"cooldown": 2000,
|
||||||
@ -121,7 +121,7 @@
|
|||||||
"projectile": "stone",
|
"projectile": "stone",
|
||||||
"projectileTextures": [],
|
"projectileTextures": [],
|
||||||
"projectileTexturesArrayLength": 1,
|
"projectileTexturesArrayLength": 1,
|
||||||
"description": "If you feel a little circular.",
|
"description": "Randomly places traps on the track, instead of attacking creeps.",
|
||||||
"stats": {
|
"stats": {
|
||||||
"damage": 2,
|
"damage": 2,
|
||||||
"cooldown": 2000,
|
"cooldown": 2000,
|
||||||
@ -140,7 +140,7 @@
|
|||||||
"projectile": "red",
|
"projectile": "red",
|
||||||
"projectileTextures": [],
|
"projectileTextures": [],
|
||||||
"projectileTexturesArrayLength": 4,
|
"projectileTexturesArrayLength": 4,
|
||||||
"description": "If you feel a little circular.",
|
"description": "On top of a regular attack, this tower gives creeps a debuff, making them take more damage.",
|
||||||
"stats": {
|
"stats": {
|
||||||
"damage": 2,
|
"damage": 2,
|
||||||
"cooldown": 2000,
|
"cooldown": 2000,
|
||||||
|
@ -165,8 +165,27 @@ export default class GameAssets {
|
|||||||
for (let idx = 0; idx < this.Creeps.length; idx++) {
|
for (let idx = 0; idx < this.Creeps.length; idx++) {
|
||||||
const creep = this.Creeps[idx];
|
const creep = this.Creeps[idx];
|
||||||
for (let i = 0; i < creep.textureArrayLength; i++) {
|
for (let i = 0; i < creep.textureArrayLength; i++) {
|
||||||
const texture = await this.Load(`./assets/creeps/${creep.name}/${i}.png`);
|
const texture = await this.Load(`./assets/creeps/${creep.sprite}/spritesheet.png`);
|
||||||
creep.textures[i] = texture;
|
const spritesheet = new PIXI.Spritesheet(texture, {
|
||||||
|
frames: {
|
||||||
|
[`${creep.sprite}_${i}.png`]: {
|
||||||
|
frame: { x: i * 128, y: 0, w: 128, h: 128 },
|
||||||
|
rotated: false,
|
||||||
|
trimmed: false,
|
||||||
|
spriteSourceSize: { x: 0, y: 0, w: 128, h: 128 },
|
||||||
|
sourceSize: { w: 128, h: 128 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
meta: {
|
||||||
|
image: `./assets/creeps/${creep.sprite}/spritesheet.png`,
|
||||||
|
format: 'RGBA8888',
|
||||||
|
size: { w: 128 * creep.textureArrayLength, h: 128 },
|
||||||
|
scale: '1',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await spritesheet.parse();
|
||||||
|
creep.textures[i] = spritesheet.textures[`${creep.sprite}_${i}.png`];
|
||||||
|
// creep.textures[i] = texture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ export type WaveDefinition = {
|
|||||||
|
|
||||||
export type CreepDefinition = {
|
export type CreepDefinition = {
|
||||||
name: string;
|
name: string;
|
||||||
|
sprite: string;
|
||||||
textures: PIXI.Texture[];
|
textures: PIXI.Texture[];
|
||||||
textureArrayLength: number;
|
textureArrayLength: number;
|
||||||
stats: CreepStatsDefinition;
|
stats: CreepStatsDefinition;
|
||||||
|
@ -116,13 +116,12 @@ export class GameScene extends Scene {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.isGameOver) return Engine.NotificationManager.Notify('No more waves.', 'danger');
|
|
||||||
if (this.roundMode == RoundMode.Misc) return;
|
if (this.roundMode == RoundMode.Misc) return;
|
||||||
this.setRoundMode(RoundMode.Combat);
|
this.setRoundMode(RoundMode.Combat);
|
||||||
this.changeRoundButton.buttonIcon.texture = GameAssets.FastForwardIconTexture;
|
this.changeRoundButton.buttonIcon.texture = GameAssets.FastForwardIconTexture;
|
||||||
this.events.emit(WaveManagerEvents.NewWave, `${this.currentRound + 1}`);
|
this.events.emit(WaveManagerEvents.NewWave, `${this.currentRound + 1}`);
|
||||||
};
|
};
|
||||||
this.MissionStats = new MissionStats(125, 450);
|
this.MissionStats = new MissionStats(100, 250);
|
||||||
this.events.on(GemEvents.TowerPanelSelectGem, (gem, index, tower) => {
|
this.events.on(GemEvents.TowerPanelSelectGem, (gem, index, tower) => {
|
||||||
if (gem == null) {
|
if (gem == null) {
|
||||||
if (!this.MissionStats.checkIfPlayerHasAnyGems())
|
if (!this.MissionStats.checkIfPlayerHasAnyGems())
|
||||||
|