javascript:labirintas
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| javascript:labirintas [2016/12/05 21:15] – aistis | javascript:labirintas [2016/12/06 00:10] (current) – aistis | ||
|---|---|---|---|
| Line 21: | Line 21: | ||
| function refresh(){ | function refresh(){ | ||
| ctx.clearRect(0, | ctx.clearRect(0, | ||
| - | | + | ctx.drawImage(img, |
| - | ctx.beginPath(); | + | ctx.beginPath(); |
| ctx.arc(x, | ctx.arc(x, | ||
| ctx.stroke(); | ctx.stroke(); | ||
| Line 29: | Line 29: | ||
| function checkKey(e) { | function checkKey(e) { | ||
| - | | + | e = e || window.event; |
| - | | + | if (e.keyCode == ' |
| - | else if (e.keyCode == ' | + | else if (e.keyCode == ' |
| - | else if (e.keyCode == ' | + | else if (e.keyCode == ' |
| - | else if (e.keyCode == ' | + | else if (e.keyCode == ' |
| - | | + | if (x < 0) x = 0; |
| - | if (y < 0) y = 0; | + | if (y < 0) y = 0; |
| - | if (x > 600) x = 600; | + | if (x > 600) x = 600; |
| - | if (y > 600) y = 600; | + | if (y > 600) y = 600; |
| refresh(); | refresh(); | ||
| }</ | }</ | ||
javascript/labirintas.1480965300.txt.gz · Last modified: by aistis
