I am making a game but i cant figure out how to keep the ellipse inside the window. how do i do this?

float x =0;
float y =0;
float snelheid_omlaag = 1;
;void setup()

void draw()

ellipse(x, y, 50, 50);
x=x+random(-90, 90);
y=y+random(-40, 40)+snelheid_omlaag;
i want the keep inside window code here

Hi @MoonAlien822 ,

Welcome to the forum! :wink:

Please format your code by using the </> button when editing a message or put backticks around your code like this : ``` code``` → code

Also it’s better to put the content of your question in the body of the message, not the title! :grinning:

If you want the ellipse to stay in the window, try to think in pixels and coordinates. What does that mean if a circle is outside the visible screen?

You can easily make a drawing on paper and try to see which information you have in order to solve that.

About the coordinate system and shapes, there’s this tutorial on the Processing website :