-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
32 lines (25 loc) · 928 Bytes
/
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
<html>
<head>
</head>
<body>
<h1>We are the Robots</h1>
<canvas id="pie" width="800" height="600"></canvas>
<script type="text/javascript">
var canvas = document.getElementById('pie');
var ctx = canvas.getContext('2d');
// Tank Tracks
var tankWidth = 100
var tankHeight=100;
ctx.fillStyle='#28251C'; ctx.fillRect(0,0,tankWidth,tankHeight);
// Tank Body
ctx.fillStyle='#8E8566'; ctx.fillRect(tankWidth/4,0,tankWidth/2,tankHeight);
// Tank Turret
ctx.beginPath();
ctx.arc(tankWidth/2,tankHeight/2,tankWidth/4,0*Math.PI,2*Math.PI);
ctx.fillStyle='#483F27'; ctx.fill();
// Tank Barrel
var barrelWidth = tankWidth/10;
ctx.fillStyle='#382F17'; ctx.fillRect(tankWidth/2-barrelWidth/2,0,barrelWidth,tankHeight/2);
</script>
</body>
</html>