-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
57 lines (48 loc) · 1.12 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import * as Phaser from 'phaser';
// Scenes
import LoadScene from './scenes/LoadScene';
import MenuScene from './scenes/MenuScene';
import DemoLevel from './scenes/DemoLevel';
const game = new Phaser.Game({
/*
width: window.innerWidth * window.devicePixelRatio,
height: window.innerHeight * window.devicePixelRatio,
*/
width: 400,
height: 300,
scene: [
LoadScene,
MenuScene,
DemoLevel,
],
render: {
pixelArt: true,
},
scale: {
parent: 'phaser',
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
width: 400,
height: 300,
},
});
/* NOTES FOR NEXT TIME:
https://phaser.io/tutorials/coding-tips-005
http://nautil.us/issue/70/variables/how-designers-engineer-luck-into-video-games-rp
- Utilize tiled tilemaps.
- Learn to use the physics engine for collisions.
this.pacman.scale.x = 1;
this.pacman.angle = 0;
if (direction === Phaser.LEFT)
{
this.pacman.scale.x = -1;
}
else if (direction === Phaser.UP)
{
this.pacman.angle = 270;
}
else if (direction === Phaser.DOWN)
{
this.pacman.angle = 90;
}
*/