Skip to content

Commit

Permalink
update assetpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Jul 11, 2024
1 parent e4c36c1 commit bc33909
Show file tree
Hide file tree
Showing 12 changed files with 7,348 additions and 14,852 deletions.
35 changes: 14 additions & 21 deletions bubbo-bubbo/.assetpack.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
import { compressJpg, compressPng } from '@assetpack/plugin-compress';
import { audio } from '@assetpack/plugin-ffmpeg';
import { json } from '@assetpack/plugin-json';
import { pixiManifest } from '@assetpack/plugin-manifest';
import { pixiTexturePacker } from '@assetpack/plugin-texture-packer';
import { webfont } from '@assetpack/plugin-webfont';
import { pixiPipes } from '@assetpack/core/pixi';

export default {
entry: './raw-assets',
output: './public/',
cache: false,
plugins: {
webfont: webfont(),
compressJpg: compressJpg(),
compressPng: compressPng(),
audio: audio(),
json: json(),
texture: pixiTexturePacker({
output: './public/assets/',
cache: true,
pipes: [
...pixiPipes({
cacheBust: false,
texturePacker: {
removeFileExtension: true,
texturePacker: {
removeFileExtension: true,
},
},
manifest: {
output: './src/manifest.json',
},
}),
manifest: pixiManifest({
output: './src/manifest.json',
}),
},
};
],
};
17,020 changes: 5,177 additions & 11,843 deletions bubbo-bubbo/package-lock.json

Large diffs are not rendered by default.

32 changes: 12 additions & 20 deletions bubbo-bubbo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"prestart": "run-s assets",
"start": "vite --open",
"clean": "rimraf dist/* public/* .assetpack/*",
"clean": "rimraf dist/* public/*",
"prebuild": "run-s clean format:check lint assets types",
"build": "vite build --base \"./\"",
"assets": "assetpack",
Expand All @@ -24,30 +24,22 @@
},
"dependencies": {
"gsap": "^3.12.5",
"pixi.js": "^8.0.3",
"pixi-filters": "^6.0.0",
"@pixi/ui": "^2.0.0",
"pixi.js": "^8.2.4",
"pixi-filters": "^6.0.4",
"@pixi/ui": "^2.1.2",
"@pixi/sound": "6.0.0",
"typed-signals": "^2.5.0"
},
"devDependencies": {
"@assetpack/cli": "^0.8.0",
"@assetpack/core": "^0.8.0",
"@assetpack/plugin-compress": "^0.8.0",
"@assetpack/plugin-ffmpeg": "^0.8.0",
"@assetpack/plugin-json": "^0.8.0",
"@assetpack/plugin-manifest": "^0.8.0",
"@assetpack/plugin-mipmap": "^0.8.0",
"@assetpack/plugin-texture-packer": "^0.8.0",
"@assetpack/plugin-webfont": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@assetpack/core": "^1.0.0-rc",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"eslint": "^8.57.0",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"typescript": "^5.4.2",
"vite": "^5.1.6"
"prettier": "^3.3.2",
"rimraf": "^6.0.1",
"typescript": "^5.5.3",
"vite": "^5.3.3"
}
}
4 changes: 2 additions & 2 deletions bubbo-bubbo/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ extensions.add(resolveJsonUrl);
/** Initialise and start background loading of all assets */
export async function initAssets() {
// Init PixiJS assets with this asset manifest
await Assets.init({ manifest });
await Assets.init({ manifest, basePath: 'assets'});

// Load assets for the load screen
await Assets.loadBundle(['images/preload', 'default']);
await Assets.loadBundle(['preload', 'default']);

// List all existing bundles names
const allBundles = manifest.bundles.map((item) => item.name);
Expand Down
2 changes: 1 addition & 1 deletion bubbo-bubbo/src/screens/GameScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class GameScreen extends Container implements AppScreen {
/** A unique identifier for the screen */
public static SCREEN_ID = 'game';
/** An array of bundle IDs for dynamic asset loading. */
public static assetBundles = ['images/game-screen'];
public static assetBundles = ['game-screen'];

private readonly _background: TilingSprite;
private readonly _game: Game;
Expand Down
2 changes: 1 addition & 1 deletion bubbo-bubbo/src/screens/LoadScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class LoadScreen extends Container {
/** A unique identifier for the screen */
public static SCREEN_ID = 'loader';
/** An array of bundle IDs for dynamic asset loading. */
public static assetBundles = ['images/preload'];
public static assetBundles = ['preload'];

private readonly _background: TilingSprite;
private readonly _spinner: Sprite;
Expand Down
2 changes: 1 addition & 1 deletion bubbo-bubbo/src/screens/ResultScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export class ResultScreen extends Container implements AppScreen {
/** A unique identifier for the screen. */
public static SCREEN_ID = 'result';
/** An array of bundle IDs for dynamic asset loading. */
public static assetBundles = ['images/results-screen'];
public static assetBundles = ['results-screen'];

private _background: TilingSprite;
/** An animated background decor instance. */
Expand Down
2 changes: 1 addition & 1 deletion bubbo-bubbo/src/screens/TitleScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class TitleScreen extends Container implements AppScreen {
/** A unique identifier for the screen */
public static SCREEN_ID = 'title';
/** An array of bundle IDs for dynamic asset loading. */
public static assetBundles = ['images/title-screen'];
public static assetBundles = ['title-screen'];

/** A container to assign user interaction to */
private readonly _hitContainer = new Container();
Expand Down
2 changes: 1 addition & 1 deletion bubbo-bubbo/src/screens/overlays/PauseOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class PauseOverlay extends Container implements AppScreen {
/** A unique identifier for the screen */
public static SCREEN_ID = 'pause';
/** An array of bundle IDs for dynamic asset loading. */
public static assetBundles = ['images/pause-overlay'];
public static assetBundles = ['pause-overlay'];

private readonly _background: Graphics;
private readonly _panel: PausePanel;
Expand Down
31 changes: 11 additions & 20 deletions puzzling-potions/.assetpack.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
import { compressJpg, compressPng } from '@assetpack/plugin-compress';
import { audio } from '@assetpack/plugin-ffmpeg';
import { json } from '@assetpack/plugin-json';
import { pixiManifest } from '@assetpack/plugin-manifest';
import { pixiTexturePacker } from '@assetpack/plugin-texture-packer';
import { webfont } from '@assetpack/plugin-webfont';
import { pixiPipes } from '@assetpack/core/pixi';

export default {
entry: './raw-assets',
output: './public/assets/',
cache: false,
plugins: {
webfont: webfont(),
compressJpg: compressJpg(),
compressPng: compressPng(),
audio: audio(),
json: json(),
texture: pixiTexturePacker({
cache: true,
pipes: [
...pixiPipes({
texturePacker: {
removeFileExtension: true,
texturePacker: {
removeFileExtension: true,
},
},
manifest: {
output: './public/assets/assets-manifest.json',
}
}),
manifest: pixiManifest({
output: './public/assets/assets-manifest.json'
}),
},
],
};

Loading

0 comments on commit bc33909

Please sign in to comment.