A simple example using Phaser with TypeScript and WebPack.
- Phaser 3.60.0
For audio to work you need installed ffmped on your system. Download from https://www.ffmpeg.org/download.html
/src/scenes/*.ts
- I have to setthis.game
andthis.sys.settings.key
manualy because....
yarn
yarn start
Template uses:
- free-tex-packer-core to merge sprites into attlases
- imagemin with imagemin-pngquant to minimalize file size.
- Add files to
/sprites
folder - Edit
/sprites/spritesheets.config.js
- Load sprites into game in
preload()
in file/src/scenes/boot.ts
- Build altlasses using:
yarn sprites
Template uses:
- audiosprite to combine multiple audio files into one, and convert
*.wav
files intomp3
,ogg
. - howler to play sounds
- Add
.wav
files into./audio
folder - Run
yarn audio
Use:
import getAudioPlayer from "./audio"; // /src/audio.ts
(await getAudioPlayer()).play('blip');
yarn build