xxxxxxxxxx
67
let img,pat;
let msg ="Perdu!";
function preload() {
pat = loadImage("patate.png");
}
function setup() {
createCanvas(windowWidth, windowHeight);
img = createGraphics(width, height);
img.fill(0);
img.rect(0, 0, width, height);
}
function draw() {
background(200);
textSize(40);
textAlign(CENTER, CENTER);
textStyle(BOLD);
colorMode(HSB,100,100,100);
fill(frameCount%100,80,0);
text(msg, width / 2-2, height / 2-2);
fill(frameCount%100,80,100);
text(msg, width / 2, height / 2);
colorMode(RGB);
image(pat,100,100);
blend(img, 0, 0, width, height, 0, 0, width, height, DARKEST);
}
function mouseDragged() {
img.fill(255);
img.ellipseMode(CENTER);
img.push();
img.translate(mouseX - 10, mouseY - 20);
img.noStroke();
img.ellipse(0, 0, 20,20);
img.pop();
}
document.ontouchmove = function (event) {
event.preventDefault();
};
function touchStarted() {
var fs = fullscreen();
if (!fs) {
fullscreen(true);
img = createGraphics(width, height);
img.fill(0);
img.rect(0, 0, width, height);
} else {
//
}
}
function touchEnded() {
//;
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
img = createGraphics(width, height);
img.fill(0);
img.rect(0, 0, width, height);
}