var wallTop, wallBottom, wallLeft, wallRight;
sprite1Img = loadImage("tronc.png")
sprite2Img = loadImage("tronc.png")
sprite3Img = loadImage("tronc.png")
sprite4Img = loadImage("grenouille.png");
backgroundImg = loadImage("background.png")
sprite1 = createSprite(width/2, height/2);
sprite1.addImage (sprite1Img);
sprite2 = createSprite(width/4, height/2);
sprite2.addImage(sprite2Img)
sprite3 = createSprite(width/1.2, height/2);
sprite3.addImage(sprite3Img)
sprite4 = createSprite(width/6, height/2);
sprite4.addImage(sprite4Img);
wallTop = createSprite(width/2, -WALL_THICKNESS/2, width+WALL_THICKNESS*2, WALL_THICKNESS);
wallTop.immovable = true;
wallBottom = createSprite(width/2, height+WALL_THICKNESS/2, width+WALL_THICKNESS*2, WALL_THICKNESS);
wallBottom.immovable = true;
wallLeft = createSprite(-WALL_THICKNESS/2, height/2, WALL_THICKNESS, height);
wallLeft.immovable = true;
wallRight = createSprite(width+WALL_THICKNESS/2, height/2, WALL_THICKNESS, height);
wallRight.immovable = true;
image(backgroundImg, 1, 1);
sprite1.bounce(wallBottom);
sprite2.bounce(wallBottom);
sprite3.bounce(wallBottom);
sprite4.collide(wallRight);
sprite4.collide(wallLeft);
sprite4.addSpeed(.1, sprite4.velocity.x +=1)
sprite4.addSpeed(.1, sprite4.velocity.x -= 1);
if(sprite4.overlap(sprite1))
if(sprite4.overlap(sprite2))
if(sprite4.overlap(sprite3))