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.gameandthis.sys.settings.keymanualy because....
yarnyarn startTemplate uses:
- free-tex-packer-core to merge sprites into attlases
- imagemin with imagemin-pngquant to minimalize file size.
- Add files to
/spritesfolder - 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
*.wavfiles intomp3,ogg. - howler to play sounds
- Add
.wavfiles into./audiofolder - Run
yarn audio
Use:
import getAudioPlayer from "./audio"; // /src/audio.ts
(await getAudioPlayer()).play('blip');
yarn build