https://github.com/enginooby-practice/phaser3
https://github.com/enginooby-practice/phaser3
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/enginooby-practice/phaser3
- Owner: enginooby-practice
- License: mit
- Created: 2020-09-16T15:22:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-18T18:58:12.000Z (almost 5 years ago)
- Last Synced: 2024-12-28T17:30:21.501Z (7 months ago)
- Language: TypeScript
- Size: 284 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
- Install node modules: ```npm install```
- Run local server: ```npm run start```
- Static resource in ```/public/assets```
- Declare optional-undefined attribute (attribute can be undefined) with ```?```: ```private player?: Phaser.Physics.Arcade.Sprite```
- Check object availability before access its optional-undefined attributes
```
if (this.player) {
doSomething(this.player.x)
}
```
- Scene structure:
- ```preload()```: load assets: images, audio, etc.
- ```create()```: add game objects to the scene (init + draw + collision)
- ```update()```: loop (events, control, animations, game over)