/
index.html
114 lines (102 loc) · 2.64 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Astro Rabbit Pig Invasion by Jeff Paterson</title>
<style>
canvas {
position: absolute;
top: 5px;
background: transparent;
}
#background {
z-index: -2;
}
#main {
z-index: -1;
}
#ship {
z-index: 0;
}
#splashscreen {
height: 100%;
width: 100%;
z-index: 99;
position: relative;
top: 25px;
color: #FF00FF;
font-family: Helvetica, sans-serif;
font-size: 24px;
font-weight: bolder;
text-align: center;
}
.score {
position: absolute;
top: 5px;
left: 580px;
color: #FF00FF;
font-family: Helvetica, sans-serif;
cursor: default;
font-weight: bold;
}
.gameLevel {
position: absolute;
top: 5px;
left: 20px;
color: #FF00FF;
font-family: Helvetica, sans-serif;
cursor: default;
font-weight: bold;
}
.game-over {
position: absolute;
top: 150px;
left: 180px;
color: #FF9900;
font-family: Helvetica, sans-serif;
font-size: 120px;
font-weight: bolder;
cursor: default;
display: none;
}
.game-over span {
font-size: 25px;
position: relative;
top: -80px;
left: 130px;
}
.game-over span:hover {
color: #FFD700;
}
#inst {
position: relative;
top: 650px;
text-align: center;
color: #FFD700;
font-family: Helvetica, sans-serif;
font-size: 16px;
cursor: default;
}
</style>
</head>
<body bgcolor="99FF66">
<!-- original size 600 x 360 -->
<div id="splashscreen"><img src="imgs/intro.png" hspace="0" vspace="50" width="600" alt="Intro screen"><P>Hold 'z' for double fire!<P>Pigs are 10 pts, but each shot costs 1 pt.</div>
<!-- The canvas for background scrolling -->
<canvas id="background" width="700" height="550">Sorry, this game requires a newer brower that supports the canvas element.</canvas>
<!-- the canvas for all enemy ships and bullets -->
<canvas id="main" width="700" height="550">
</canvas>
<!-- the canvas the player's ship uses (movement limited to bottom quarter of screen) -->
<canvas id="ship" width="700" height="550">
</canvas>
<div class="score">SCORE: <span id="score"></span></div>
<div class="gameLevel">LEVEL: <span id="gameLevel"></span></div>
<div class="game-over" id="game-over">GAME<BR>OVER<p><span onclick="game.restart()">START</span></p></div>
<div id="loading"></div>
<div id="inst"></div>
<div class="gameLevel"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="invasion.js"></script>
</body>
</html>