hello i need help in order to make a labyrinth I have already done all the part to make the ellipse move, now I want to create the labyrinth itself and i have 2 ideas : making a labyrinth with some lines or rect Or adding a background image of a labyrinth and detect the black pixels
here’s the code i have for now:
balle B1 = new balle(width/2,width-10,10);
void setup()
{
size(600,600);
background(255);
}
void draw()
{
background(255);
B1.render();
}
class balle {
int x;
int y;
int r;
balle(int x_,int y_, int r_){
x = x_;
y = y_;
r = r_;
}
void render()
{
if(keyPressed == true)
{
if(key == CODED)
{
if (keyCode == UP && (y-r/2)>0)
{
y--;
}
if (keyCode == DOWN && (y+r/2)<width)
{
y++;
}
if (keyCode == LEFT && (x-r/2>0))
{
x--;
}
if(keyCode == RIGHT && (x+r/2)<width)
{
x++;
}
}
}
ellipse(x,y,r,r);
}
}
thank’s for your help