-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
81 lines (68 loc) · 1.73 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pixel Game</title>
<link rel="stylesheet" href="style.css">
<script src="app.js"></script>
<script>
let game; // In the global scope for debugging
window.addEventListener("DOMContentLoaded", () => {
const WIDTH = 800, HEIGHT = 600;
let canvas = document.createElement("canvas");
let gameArea = document.getElementById("gameArea");
canvas.width = WIDTH;
canvas.height = HEIGHT;
canvas.style.border = "1px solid black";
canvas.oncontextmenu = () => false;
gameArea.appendChild(canvas);
game = new Game({ x: WIDTH, y: HEIGHT }, canvas);
})
</script>
</head>
<body>
<div id="sidebar">
<h1>Pixel Game</h1>
<h2>Ishan Bhargava</h2>
<p class="small">
<a href="https://github.com/ishantheperson/pixel-game" target="_blank">
source on GitHub
</a> -
<a href="http://andrew.cmu.edu/user/ibhargav">home</a>
</p>
<p>
Click to add pixels<br>
Right/Shift-click to use a tool and <kbd>P</kbd> to pause
</p>
<p class="small">
<span id="pixelCount"></span> pixels
</p>
<div id="items">
<div id="tools" class="selectArea">
<h3>Tools</h3>
<div>
<p class="selected">Eraser</p>
<p>FloodEraser</p>
<p>Explosion</p>
<p>Attract</p>
</div>
</div>
<div id="elements" class="selectArea">
<h3>Pixels</h3>
<div class="optionList">
<p class="selected">Sand</p>
<p>Block</p>
<p>Water</p>
<p>Magma</p>
<p>Clone</p>
<p>Oil</p>
<p>Fuse</p>
<p>Stone</p>
<p>Portal</p>
</div>
</div>
</div>
</div>
<div id="gameArea"></div>
</body>
</html>