Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as PIXI from 'pixi.js';
import { registerPerform } from '@/Core/util/pixiPerformManager/pixiPerformManager';
import { WebGAL } from '@/Core/WebGAL';
import { SCREEN_CONSTANTS } from '@/Core/util/constants';
import cherryBlossomsTextureUrl from '@/assets/tex/cherryBlossoms.webp';

type ContainerType = 'foreground' | 'background';

Expand Down Expand Up @@ -59,7 +60,7 @@ const pixiCherryBlossoms = (
container.addChild(particleContainer);

const sakuras: SakuraSprite[] = [];
const texture = PIXI.Texture.from('./game/tex/cherryBlossoms.webp');
const texture = PIXI.Texture.from(cherryBlossomsTextureUrl);

const randRange = (min: number, max: number): number => min + Math.random() * (max - min);

Expand Down
6 changes: 3 additions & 3 deletions packages/webgal/src/Core/gameScripts/pixi/performs/rain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as PIXI from 'pixi.js';
import { registerPerform } from '@/Core/util/pixiPerformManager/pixiPerformManager';
import { WebGAL } from '@/Core/WebGAL';
import { SCREEN_CONSTANTS } from '@/Core/util/constants';
import rainTextureUrl from '@/assets/tex/rain.png';

type ContainerType = 'foreground' | 'background';

Expand Down Expand Up @@ -59,7 +60,6 @@ const pixiRain = (
const raindropTextures: PIXI.Texture[] = [];
const raindrops: RaindropSprite[] = [];

const baseTexturePath = './game/tex/rain.png';
const SPRITE_WIDTH = 128;
const SPRITE_HEIGHT = 640;
const NUM_SPRITES = 5;
Expand Down Expand Up @@ -133,7 +133,7 @@ const pixiRain = (
while (raindrops.length > 0) raindrops.pop();
particleContainer.removeChildren();

const baseTexture = PIXI.BaseTexture.from(baseTexturePath);
const baseTexture = PIXI.BaseTexture.from(rainTextureUrl);

const finalizeSetup = () => {
if (baseTexture.valid) {
Expand Down Expand Up @@ -174,7 +174,7 @@ const pixiRain = (
finalizeSetup();
});
baseTexture.once('error', (errorEvent) => {
console.error(`Error loading base texture ${baseTexturePath}:`, errorEvent);
console.error(`Error loading base texture ${rainTextureUrl}:`, errorEvent);
finalizeSetup();
});
}
Expand Down
6 changes: 3 additions & 3 deletions packages/webgal/src/Core/gameScripts/pixi/performs/snow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as PIXI from 'pixi.js';
import { registerPerform } from '@/Core/util/pixiPerformManager/pixiPerformManager';
import { WebGAL } from '@/Core/WebGAL';
import { SCREEN_CONSTANTS } from '@/Core/util/constants';
import snowTextureUrl from '@/assets/tex/snow.png';

type ContainerType = 'foreground' | 'background';

Expand Down Expand Up @@ -60,7 +61,6 @@ const pixiSnow = (
const snowflakeTextures: PIXI.Texture[] = [];
const snowflakes: SnowflakeSprite[] = [];

const baseTexturePath = './game/tex/snow.png';
const SPRITE_WIDTH = 128;
const SPRITE_HEIGHT = 128;
const NUM_SPRITES = 10;
Expand Down Expand Up @@ -138,7 +138,7 @@ const pixiSnow = (
while (snowflakes.length > 0) snowflakes.pop();
particleContainer.removeChildren();

const baseTexture = PIXI.BaseTexture.from(baseTexturePath);
const baseTexture = PIXI.BaseTexture.from(snowTextureUrl);

const finalizeSetup = () => {
if (baseTexture.valid) {
Expand Down Expand Up @@ -179,7 +179,7 @@ const pixiSnow = (
finalizeSetup();
});
baseTexture.once('error', (errorEvent) => {
console.error(`Error loading base texture ${baseTexturePath}:`, errorEvent);
console.error(`Error loading base texture ${snowTextureUrl}:`, errorEvent);
finalizeSetup();
});
}
Expand Down
Loading