diff --git a/week-09/event2/index.html b/week-09/event2/index.html index 91dabfa..d10f721 100644 --- a/week-09/event2/index.html +++ b/week-09/event2/index.html @@ -49,9 +49,26 @@ drawCircle(x, y, size); - // Add your code here + window.addEventListener("keydown", e => { + switch (e.key) { + case "w": + y -= 10; + break; + case "a": + x -= 10; + break; + case "s": + y += 10; + break; + case "d": + x += 10; + break; + } + + drawCircle(x, y, size); + }); - - + +