# I need help on Processing 3

**URL:** <https://discourse.processing.org/t/i-need-help-on-processing-3/6663>\
**Category:** Coding Questions\
**Created:** [December 16, 2018, 6:46pm UTC](https://discourse.processing.org/t/i-need-help-on-processing-3/6663 "2018-12-16T18:46:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![figraham](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/figraham/32/4161_2.png) [@figraham](https://discourse.processing.org/u/figraham)\
**Post date:** [December 16, 2018, 8:53pm UTC](https://discourse.processing.org/t/i-need-help-on-processing-3/6663/2 "2018-12-16T20:53:28Z")

</div>

I’m guessing you’re in the same class as the person who posted [this](https://discourse.processing.org/t/need-help-for-a-laby/6661). I’d suggest mostly the same code for you. You just may need to account for where you are drawing the ellipse.

```auto
maze1.loadPixels();

boolean isValidLocation(x, y) { // custom function that takes in an x and y and returns true or false 
  x += 249; //accounts for where you are drawing the ellipse
  y += 187;
  if (maze1.pixels[x + y * width] == color(255)) {
    return true;
  }
  return false;
}

// then change your all your keyPressed if statements to something like this
if (keyCode == DOWN && isValidLocation(x, y - 8)) { // won't move if ellipse would hit a wall
  // all the same code
}

```

---

_[View the full topic](https://discourse.processing.org/t/i-need-help-on-processing-3/6663)._
