# Can i send someone my code and they can explain why i have an error and how to fix it

**URL:** <https://discourse.processing.org/t/can-i-send-someone-my-code-and-they-can-explain-why-i-have-an-error-and-how-to-fix-it/36845>\
**Category:** Beginners\
**Created:** [May 12, 2022, 12:50pm UTC](https://discourse.processing.org/t/can-i-send-someone-my-code-and-they-can-explain-why-i-have-an-error-and-how-to-fix-it/36845 "2022-05-12T12:50:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-54](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@anonymous-54](https://discourse.processing.org/u/anonymous-54)\
**Post date:** [May 12, 2022, 12:50pm UTC](https://discourse.processing.org/t/can-i-send-someone-my-code-and-they-can-explain-why-i-have-an-error-and-how-to-fix-it/36845/1 "2022-05-12T12:50:54Z")

</div>

can i send someone my code and they can explain why i have an error and how to fix it

---

<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:** [May 12, 2022, 1:13pm UTC](https://discourse.processing.org/t/can-i-send-someone-my-code-and-they-can-explain-why-i-have-an-error-and-how-to-fix-it/36845/2 "2022-05-12T13:13:21Z")

</div>

Yeah just post it and we have a look

---

<div class="post-metadata">

**Author:** ![anonymous-54](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@anonymous-54](https://discourse.processing.org/u/anonymous-54)\
**Post date:** [May 12, 2022, 1:14pm UTC](https://discourse.processing.org/t/can-i-send-someone-my-code-and-they-can-explain-why-i-have-an-error-and-how-to-fix-it/36845/3 "2022-05-12T13:14:13Z")

</div>

int xKite = mouseX;  
int yKite = mouseY;  
int xSpeed = 5;  
int ySpeed = 5;

int count;  
int displayText;

boolean sky,  
draggable = false;

int level=1;  
int level=2;

void setup() {  
size(1000, 600);  
}

void draw() {  
if (level==1) {  
count = 1;  
displayText(count);  
textSize(14);  
fill(255);  
text (“Press, then drag, the mouse in the brown area (rooftop) to begin”);

```
background(121, 218, 252);

fill(84, 41, 41);
rect(0, (4 * height)/4, width * 2, height/2);
rectMode(CENTER);

strokeWeight(13);
stroke(137, 122, 91);
line(333, 600, 333, 0);

stroke(0);
strokeWeight(3);
line(0, 25, 325, 25);
line(0, 50, 325, 50);
line(0, 75, 325, 75);

strokeWeight(1);
line(0, 37.5, 326, 37.5);
line(0, 62.5, 326, 62.5);

if (sky) {
  yKite -= ySpeed;
}

if (xKite<390 && xKite>0 && yKite<75 && yKite>0) {
  xSpeed=0;
  ySpeed=0;
}

noStroke();
fill(252, 65, 188);
triangle(xKite, yKite, xKite - 50, yKite, xKite - 50, yKite + 50);
triangle(xKite - 50, yKite, xKite - 100, yKite, xKite - 50, yKite - 50);

ellipseMode(CENTER);
rectMode(CENTER);
fill(0, 0, 255);
ellipse(xKite - 50, yKite, 50, 50);

fill(255, 105, 180);
ellipse(xKite - 50, yKite, 40, 40);

fill(255, 255, 55);
triangle(xKite, yKite, xKite - 50, yKite, xKite - 50, yKite - 50);
triangle(xKite - 50, yKite, xKite - 100, yKite, xKite - 50, yKite + 50);

fill(0, 0, 255);
rect(xKite - 50, yKite, 20, 20);

fill(0, 255, 0);
rect(xKite - 50, yKite, 17.5, 17.5);

stroke(125);
line(xKite - 50, yKite + 50, xKite - 42.5, yKite + 125);

stroke(125);
fill(0, 255, 0);

triangle(xKite - 50, yKite + 50, xKite - 70, yKite + 70, xKite - 30, yKite + 70);

stroke(125);
noFill();
ellipse(xKite - 57.5, yKite + 50, 17.5, 7.5);
ellipse(xKite - 42.5, yKite + 50, 17.5, 7.5);

strokeWeight(3);
line(xKite - 50, yKite + 50, xKite - 57.5, yKite + 95);

```

}  
}  
}  
void mousePressed() {

if (!sky) {  
if (mouseY \> 450) {  
draggable = true;

```
  xKite = mouseX;
  yKite = mouseY;
} else if (mouseY < 450) {
  draggable = false;
}

```

}  
}

void mouseDragged() {  
if (draggable) {

```
yKite = mouseY;
xKite = mouseX;

```

}  
}

void mouseReleased() {

if (draggable && mouseY \<= 450) {  
draggable = false;  
sky = true;  
}  
}

---

<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:** [May 12, 2022, 1:31pm UTC](https://discourse.processing.org/t/can-i-send-someone-my-code-and-they-can-explain-why-i-have-an-error-and-how-to-fix-it/36845/4 "2022-05-12T13:31:10Z")

</div>

WHAT is the error and which functions do we have to look at…?

(or from your other thread…?)

I receive multiple errors, one is that the function displayText() is unknown - do you have this function, maybe in another tab?

What is “`level`” supposed to do? This won’t work:

```auto
// ??? 
int level=1;
int level=2;

```

**Remarks**

- The brown rectangle is the roof? Why is it below? Sorry, I am not sure I understand.

- Remark: `rectMode(CENTER);` must be **before** `rect()` to have effect.
