SHOW:
|
|
- or go back to the newest paste.
1 | <!DOCTYPE html> | |
2 | <html> | |
3 | <head> | |
4 | <meta charset="utf-8"> | |
5 | <title>Pacman Test</title> | |
6 | </head> | |
7 | <body onload="onloaded()"> | |
8 | <canvas id="canvas" width="400" height="400" style="position: absolute; left: 0; top: 0; z-index: 0;"> | |
9 | </canvas> | |
10 | <script> | |
11 | ||
12 | ////////////////////////////////// | |
13 | function onloaded() { | |
14 | var canvas; | |
15 | var ctx; | |
16 | var DEGREES = Math.PI * 180; | |
17 | ||
18 | // canvas ( used for all other objects ) | |
19 | canvas = document.getElementById("canvas"); | |
20 | ctx = canvas.getContext("2d"); | |
21 | ||
22 | // draw pacman shape | |
23 | ctx.arc(200,200,50, -45 * DEGREES, 45 * DEGREES, true); | |
24 | ctx.stroke(); | |
25 | } | |
26 | ||
27 | </script> | |
28 | </body> | |
29 | ||
30 | </html> |