-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest-scene.html
More file actions
33 lines (32 loc) · 775 Bytes
/
test-scene.html
File metadata and controls
33 lines (32 loc) · 775 Bytes
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
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.min.js"></script>
</head>
<body>
<div id="game"></div>
<script>
const config = {
type: Phaser.AUTO,
width: 800,
height: 600,
parent: 'game',
backgroundColor: '#87CEEB',
scene: {
preload: function() {
console.log('PRELOAD called');
},
create: function() {
console.log('CREATE called');
this.add.rectangle(400, 300, 100, 100, 0xFF0000);
this.add.text(400, 300, 'TEST', { color: '#000' });
},
update: function() {
}
}
};
const game = new Phaser.Game(config);
console.log('Game created:', game);
</script>
</body>
</html>