(e)
| 53 | } |
| 54 | //handler for keys |
| 55 | function handleKeys(e) { |
| 56 | if (e.key.includes("Arrow")) { |
| 57 | draw({ key: e.key }); |
| 58 | //if they key name is arrowup or arrow down or arrowleft or arrowright |
| 59 | } |
| 60 | } |
| 61 | //shake and clear function |
| 62 | function clearcanvas() { |
| 63 | canvas.classList.add("shake"); |