Skip to content

Commit

Permalink
update readme for example
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Westover <[email protected]>
  • Loading branch information
scottwestover committed Jul 3, 2024
1 parent f7e33ba commit a2f7778
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions examples/3.80/loading-assets-with-json-pack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

Contains example code of how you can use the built in [Phaser 3 Pack Loader](https://newdocs.phaser.io/docs/3.80.0/focus/Phaser.Loader.LoaderPlugin-pack) to load your various asset files from one central JSON file. This can help you keep your code and config isolated.

Contains example code of how you can use the built in Phaser 3 Arcade Physics Engine to create a conveyor belt like game object that will move objects automatically, and modify their speed when the objects are moving.

You can see a live demo of the example here: [Phaser 3 Asset Loading via Pack Loader Demo](https://devshareacademy.github.io/phaser-3-typescript-games-and-examples/examples/arcade-physics-conveyor-belt/index.html)
You can see a live demo of the example here: [Phaser 3 Asset Loading via Pack Loader Demo](https://devshareacademy.github.io/phaser-3-typescript-games-and-examples/examples/loading-assets-with-json-pack/index.html)

![Example](./docs/example.png?raw=true)

By using the JSON file for loading assets, your `preload` code can go from this:

![Example 1](./docs/example1.png?raw=true)

to this:

![Example 2](./docs/example2.png?raw=true)

## Local Development

### Requirements
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/3.80/loading-assets-with-json-pack/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class Game extends Phaser.Scene {
// this.load.setPath('assets/audio/xDeviruchi');
// this.load.audio('title_theme', 'Title-Theme.wav');

// uncomment this line and comment out code above for example
// asset pack example
// this.load.pack('asset_pack', 'assets/data/assets.json');
}
Expand Down

0 comments on commit a2f7778

Please sign in to comment.