# Assessment wanted for Event 2 skill test

**URL:** <https://discourse.mozilla.org/t/assessment-wanted-for-event-2-skill-test/110208>\
**Category:** Learn\
**Created:** [January 21, 2023, 10:30am UTC](https://discourse.mozilla.org/t/assessment-wanted-for-event-2-skill-test/110208 "2023-01-21T10:30:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vkhtgpt5](https://avatars.discourse-cdn.com/v4/letter/v/e19adc/32.png) [@vkhtgpt5](https://discourse.mozilla.org/u/vkhtgpt5)\
**Post date:** [January 21, 2023, 10:30am UTC](https://discourse.mozilla.org/t/assessment-wanted-for-event-2-skill-test/110208/1 "2023-01-21T10:30:41Z")

</div>

I am having little trouble understanding why the circle is not moving. Below link has the code:

https://codepen.io/vikhyatgupta19/embed/preview/gOjodoE?default-tabs=js%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=gOjodoE

---

<div class="post-metadata">

**Author:** ![mikoMK](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/mikomk/32/50456_2.png) [@mikoMK](https://discourse.mozilla.org/u/mikoMK)\
**Post date:** [February 5, 2023, 4:15pm UTC](https://discourse.mozilla.org/t/assessment-wanted-for-event-2-skill-test/110208/2 "2023-02-05T16:15:06Z")

</div>

Hi @vkhtgpt5 and welcome to the community 👋

Sorry for the looong delay.

You don’t actually update the `x` or `y` value in your `case`s. Setting `KeyD` etc. doesn’t do anything. Also `keyCode` is deprecated. It’s better to either use [KeyboardEvent.code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code) or [KeyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key).

A working solution could be:

```auto
window.addEventListener('keydown', e => {
  switch(e.key) {
    case 'a':
      x -= 2;
      break;
    case 'd':
      x += 2;
      break;
    case 'w':
      y -= 2;
      break;
    case 's':
      y += 2;
      break;
  }

  drawCircle(x, y, size);
});

I hope that helps,
Michael

```
