-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathindex.html
60 lines (52 loc) · 2.3 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>
<!-- copied from https://raw.githubusercontent.com/mdn/webassembly-examples/master/understanding-text-format/logger2.html (CC0) -->
<html>
<head>
<meta charset="utf-8">
<title>DooM</title>
<style>
#output {
border: 3px groove aquamarine;
background-color: bisque;
width: 550px;
height: 400px;
font-family: monospace, serif;
font-size: 10px;
overflow-y: scroll;
}
#output span.log {
color:darkslateblue;
}
#output span.stdout {
color: black;
}
#output span.stderr {
font-weight: bold;
color:brown;
}
.container {
display: flex;
}
</style>
</head>
<body>
<h1>DooM</h1>
<p>A wasm32 port of 1997 linuxdoom-1.10 with minimal modifications to the <a href="https://github.com/id-Software/DOOM">sources</a>. Find all the details in the README of the <a href="https://github.com/diekmann/wasm-fizzbuzz">WebAssembly from Scratch Article</a>.</p>
<p id="focushint"></p>
<p>Use <button id="enterButton">⏎</button> to start the game,
arrow keys <button id="leftButton">←</button> <button id="upButton">↑</button> <button id="downButton">↓</button> <button id="rightButton">→</button> to move,
<button id="ctrlButton">ctrl</button> to shoot,
spacebar <button id="spaceButton"> </button> to open gates,
<button id="altButton">alt</button> and arrow keys to strafe (if your browser does not handle these keys otherwise).
On mobile (and mobile only) touch the buttons above. Yeah, I'm not good a UX design.</p>
<div class="container">
<canvas id="screen" width="640" height="400" tabindex="0">This is where the DooM screen should render.</canvas>
<span> </span>
<div id="output"></div>
</div>
gettmilliseconds calls per second: <span id="getmsps_stats">0</span> Total getmilliseconds calls: <span id="getms_stats">0</span><br>
DooM FPS: <span id="fps_stats">0</span> (target: 35FPS) Total Frames drawn: <span id="drawframes_stats">0</span><br>
Browser Animation FPS: <span id="animationfps_stats">0</span> (target: around 60FPS, depending on browser)<br>
<script src="main.js" defer></script>
</body>
</html>