-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
60 lines (59 loc) · 2.04 KB
/
index.html
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
58
59
60
<!DOCTYPE html>
<html>
<head>
<title>Chistmas Impossible</title>
<script src="//cdn.jsdelivr.net/npm/[email protected]/build/phaser.js"></script>
<script src="src/titleScreen.js"></script>
<script src="src/flyGame.js"></script>
<script src="src/gameHouse.js"></script>
<script src="src/gameOverScreen.js"></script>
<style>
body {
background-image: url("resources/christmas-background.jpg");
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
#center{
position: absolute;
width: 800px;
height: 800px;
margin: -100px 0 0 -400px;
left: 50%;
top: 50%;
}
#game {
width: 800px;
height: 600px;
}
#controls {
width: 800px;
height: 200px;
}
p{
color: red;
}
</style>
</head>
<body>
<div id=center>
<div id="game"></div>
<br>
<div id="controls">
<p>Controls for flying: Arrow keys</p>
<p>Controls in the house: "Arrow-down" to place the gift under the tree. "Spacebar" to jump. "Arrow-left" and "Arrow-right" to move left/right.</p>
</div>
</div>
<script>
(function() {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, document.querySelector('#game'));
game.state.add("titleScreen", titleScreen);
game.state.add("flyGame", flyGame);
game.state.add("gameHouse", gameHouse);
game.state.add("gameOverScreen", gameOverScreen);
game.state.start("titleScreen",true,false,0,1,30);
})();
</script>
</body>
</html>