Skip to content

Commit 549fb6a

Browse files
committed
[Prettier] config prettier
1 parent f30de95 commit 549fb6a

File tree

4 files changed

+39
-30
lines changed

4 files changed

+39
-30
lines changed

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"tabWidth": 4,
3+
"useTabs": false,
4+
"singleQuote": true,
5+
"endOfLine": "lf",
6+
"semi": false
7+
}

src/index.html

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
<html>
2-
<head>
3-
<title>Phaser3 + Parceljs Template</title>
4-
</head>
5-
<body>
6-
<script src="main.ts"></script>
7-
</body>
8-
</html>
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>LOL2D</title>
8+
</head>
9+
10+
<body>
11+
<script src="main.ts"></script>
12+
</body>
13+
14+
</html>

src/main.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import Phaser from 'phaser'
33
import HelloWorldScene from './scenes/HelloWorldScene'
44

55
const config: Phaser.Types.Core.GameConfig = {
6-
type: Phaser.AUTO,
7-
width: 800,
8-
height: 600,
9-
physics: {
10-
default: 'arcade',
11-
arcade: {
12-
gravity: { y: 200 }
13-
}
14-
},
15-
scene: [HelloWorldScene]
6+
type: Phaser.AUTO,
7+
width: 800,
8+
height: 600,
9+
physics: {
10+
default: 'arcade',
11+
arcade: {
12+
gravity: { y: 200 },
13+
},
14+
},
15+
scene: [HelloWorldScene],
1616
}
1717

1818
export default new Phaser.Game(config)

src/scenes/HelloWorldScene.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
11
import Phaser from 'phaser'
22

3-
export default class HelloWorldScene extends Phaser.Scene
4-
{
5-
constructor()
6-
{
7-
super('hello-world')
8-
}
9-
10-
preload()
11-
{
3+
export default class HelloWorldScene extends Phaser.Scene {
4+
constructor() {
5+
super('hello-world')
6+
}
7+
8+
preload() {
129
this.load.setBaseURL('http://labs.phaser.io')
1310

1411
this.load.image('sky', 'assets/skies/space3.png')
1512
this.load.image('logo', 'assets/sprites/phaser3-logo.png')
1613
this.load.image('red', 'assets/particles/red.png')
1714
}
1815

19-
create()
20-
{
16+
create() {
2117
this.add.image(400, 300, 'sky')
2218

2319
const particles = this.add.particles('red')
2420

2521
const emitter = particles.createEmitter({
2622
speed: 100,
2723
scale: { start: 1, end: 0 },
28-
blendMode: 'ADD'
24+
blendMode: 'ADD',
2925
})
3026

3127
const logo = this.physics.add.image(400, 100, 'logo')

0 commit comments

Comments
 (0)