# How to move shape

**URL:** <https://discourse.processing.org/t/how-to-move-shape/26066>\
**Category:** Coding Questions\
**Created:** [December 8, 2020, 11:32pm UTC](https://discourse.processing.org/t/how-to-move-shape/26066 "2020-12-08T23:32:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adamasmal02](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Adamasmal02](https://discourse.processing.org/u/Adamasmal02)\
**Post date:** [December 8, 2020, 11:32pm UTC](https://discourse.processing.org/t/how-to-move-shape/26066/1 "2020-12-08T23:32:25Z")

</div>

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/18d382aa8a07c469a2fb324db21bdcdb319ca9a4.jpeg)  
I have made this so far I’m new to processing I’m wondering how I can make it move right left up and down

---

<div class="post-metadata">

**Author:** ![Adamasmal02](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Adamasmal02](https://discourse.processing.org/u/Adamasmal02)\
**Post date:** [December 8, 2020, 11:54pm UTC](https://discourse.processing.org/t/how-to-move-shape/26066/2 "2020-12-08T23:54:42Z")

</div>

So I can move it with my keyboard

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [December 9, 2020, 12:27am UTC](https://discourse.processing.org/t/how-to-move-shape/26066/3 "2020-12-09T00:27:18Z")

</div>

```auto
float x=333, y=333, w, h; // values 

void setup() {
  // Fenster wird erstellt
  size (425, 600);
}

void draw() {
  background(0); 
  ellipse(x, y, 19, 19);
}

void keyPressed() {
  if (key=='w')
    y--;
  if (key=='s')
    y++;

  if (key=='a')
    x--;
  if (key=='d')
    x++;
}

```
