-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
96 lines (92 loc) · 1.99 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
<html>
<head>
<style>
#canvas {
border: 1px solid black;
top: 0px;
left: 0px;
}
.button {
position: absolute;
border: 1px solid black;
}
#left-controls {
position: absolute;
left: 1px;
bottom: 0px;
display: none;
}
#right-controls {
position: absolute;
right: 1px;
bottom: 0px;
display: none;
}
#up {
width: 200px;
height: 100px;
bottom: 100px;
}
#left {
width: 100px;
height: 100px;
bottom: 0px;
}
#right {
width: 100px;
height: 100px;
bottom: 0px;
left: 100px;
}
#space {
width: 200px;
height: 200px;
bottom: 0px;
right: 0px;
}
</style>
</head>
<body>
<div id="game-container">
<canvas
id="canvas"
autoplay="true"
muted="true"
width="780"
height="540"
></canvas>
<div id="left-controls">
<div id="up" class="button">THRUST</div>
<div id="left" class="button">LEFT</div>
<div id="right" class="button">RIGHT</div>
</div>
<div id="right-controls">
<div id="space" class="button">FIRE</div>
</div>
</div>
<br />
<br />
<br />
<small>
<em>
<p>
TypeScript Asteroids by Ben Creech (<a
href="https://github.com/bpcreech/typescript-asteroids"
>source</a
>)
</p>
<p>
this is a TypeScript port of Doug McInnes's original
<a href="http://dougmcinnes.com/2010/05/12/html-5-asteroids/"
>JavaScript-based HTML5 Asteroids</a
>
(<a href="https://github.com/dmcinnes/HTML5-Asteroids">source</a>).
</p>
</em>
</small>
<script type="module">
import { start } from "/src/start.ts";
start("canvas");
</script>
</body>
</html>