Skip to content

Commit

Permalink
moving circle wooo
Browse files Browse the repository at this point in the history
  • Loading branch information
kmr18006 committed Mar 21, 2024
1 parent 6ebdb49 commit f09c1e9
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions week-09/event2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

</script>
</body>

</body>
</html>

0 comments on commit f09c1e9

Please sign in to comment.