forked from BertrandDechoux/d3js-sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
d3js-mower-demo.html
37 lines (36 loc) · 1.17 KB
/
d3js-mower-demo.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>a D3.js powered mower</title>
<meta name="description" content="">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="d3js-mower-demo.js"></script>
<link rel="stylesheet" type="text/css" href="d3js-mower-demo.css">
</head>
<body>
<div class="display">
</div>
<div class="control">
<textarea readonly rows="8" cols="50">
Type commands in the input below in order to move the mower.
W : move up
S : move down
D : move right
A : move left
</textarea>
<br/>
<textarea id="commands" rows="8" cols="50"></textarea>
<br/>
<textarea readonly rows="8" cols="50">
Be careful! There are 3 kinds of terrain:
green -> grass, where the mower should be, most of the time
gray -> rock, where the mower can't go
red -> lava, where the mower will turn into ashes
This game is a proof of concept using d3js, feel free to fork and improve.
</textarea>
</div>
<br/>
</body>
</html>