still not working i don’t understand
PImage labyFond;
int x;
int y;
PImage[] Yoshi = new PImage[7];
color b = color (255,255,255); //White
color q;
color r;
color s;
color t;
void setup()
{
size(1024,1024);
frameRate(30);
labyFond = loadImage(“laby.png”);
Yoshi[0] = loadImage( “Yoshi0.gif” );
Yoshi[1] = loadImage( “Yoshi1.gif” );
Yoshi[2] = loadImage( “Yoshi2.gif” );
Yoshi[3] = loadImage( “Yoshi3.gif” );
Yoshi[4] = loadImage( “Yoshi4.gif” );
Yoshi[5] = loadImage( “Yoshi5.gif” );
Yoshi[6] = loadImage( “Yoshi6.gif” );
x=-5;
y=117;
}
void check_color(){
// get the color of the pixel next to Yoshi :
q =labyFond.get(x,y-2); //Color above Yoshi
r= labyFond.get(x,y+2); //Color under Yoshi
s= labyFond.get(x-2,y); //Color on the left of Yoshi
t= labyFond.get(x+2,y); //Color on the right of Yoshi
}
void draw()
{
background(labyFond);
image( labyFond, 0, 0, width, height );
image( Yoshi[frameCount%1], x, y );
}
void keyPressed(){
check_color();
if (key==CODED){
if ((keyCode==UP) &&( q == b)) {
y = y-2; // notre Yoshi avance vers le haut
}
if ((keyCode==DOWN)&&( r == b)) {
y = y+2; // notre Yoshi avance vers le bas
}
if ((keyCode==LEFT)&&( s == b)) {
x = x-2; // notre Yoshi avance vers la gauche
}
if ((keyCode==RIGHT)&&( t == b)) {
x = x+2; // notre Yoshi avance vers la droite
}
}
}