xxxxxxxxxx
47
var box, asterisk, cloud, circle;
function setup() {
createCanvas(500, 500);
//LE CERLCE GRIS SURVOL
circle = createSprite(250, 250);
circle.addImage(loadImage('plain_circle.png'));
//LE CERCLE PIXEL QUI SUIT LA SOURIS
asterisk = createSprite(100, 100);
asterisk.addAnimation('normal', 'asterisk_normal0001.png', 'asterisk_normal0002.png');
asterisk.addAnimation('round', 'asterisk_normal0003.png', 'asterisk_normal0004.png');
//LE MUR
box = createSprite(100, 250);
box.addAnimation('normal', 'box01.png', 'box02.png');
//LA CERCLE NOIR ET BLANC
cloud = createSprite(300, 200);
cloud.addAnimation('normal', 'cercle01.png', 'cercle02.png');
}
function draw() {
background(24);
asterisk.position.x = mouseX;
asterisk.position.y = mouseY;
if(asterisk.overlap(circle))
asterisk.changeAnimation('round');
else
asterisk.changeAnimation('normal');
asterisk.collide(box);
asterisk.displace(cloud);
asterisk.debug = mouseIsPressed;
circle.debug = mouseIsPressed;
box.debug = mouseIsPressed;
cloud.debug = mouseIsPressed;
drawSprites();
}