xxxxxxxxxx
115
let fortunes = [
"No se puede construir el mañana demoliendo el ayer",
"Aferrarse a los afectos para resistir, agitar el corazón para cimentar",
"Lo que el alma hace al cuerpo, la artista hace al pueblo",
"Mi único país es mi memoria y no tiene himnos",
"La esperanza es un territorio que no aparece en el mapa",
"La visión no morirá destruyendo ojos",
"Abraza tu tierra, encuentra tu río",
"La memoria es ingobernable",
"El corazón tiene el tamaño de un puño",
"Brotaremos de nuevo como bosque nativo",
"Que su revolución les de un pedazo de cielo rojo",
"Le entrego mi alma al vacío",
"Ternura radical contra el capital",
"Nuestros muertos están cada día más vivos en una canción de amor que los renace",
"Donde no se seca la humedad porfiada de su recuerdo",
];
let currentFortune = "";
let fondo;
function preload() {
fondo =loadImage('/assets/datacenter.jpg');
arveja =loadImage('/assets/arveja.png');
azul =loadImage('/assets/azul.png');
caballero =loadImage('/assets/caballero.png');
cisne =loadImage('/assets/cisne.png');
estelar =loadImage('/assets/estelar.png');
haba =loadImage('/assets/haba.png');
pallares =loadImage('/assets/pallares.png');
muchos =loadImage('/assets/muchos.png');
}
function setup() {
createCanvas(1000, 500);
image(fondo, 0, 0, width, height, 0, 0, fondo.width, fondo.height, COVER);
image(haba,5,160,150,190);
image(caballero,170,150,80,100);
image(estelar,280,150,70,90);
image(pallares,860,150,110,130);
image(cisne,750,150,90,110);
image(arveja,650,150,90,90);
image(muchos,400,350,250,250);
// Create a button and place it beneath the canvas.
let fortuneButton = createButton('Mensaje');
fortuneButton.position(50,150);
// Call repaint() when the button is pressed.
fortuneButton.mousePressed(pickFortune);
// Create a button and place it beneath the canvas.
let fortuneButton2 = createButton('Mensaje');
fortuneButton2.position(190,120);
// Call repaint() when the button is pressed.
fortuneButton2.mousePressed(pickFortune);
// Create a button and place it beneath the canvas.
let fortuneButton3 = createButton('Mensaje');
fortuneButton3.position(310,110);
// Call repaint() when the button is pressed.
fortuneButton3.mousePressed(pickFortune);
// Create a button and place it beneath the canvas.
let fortuneButton4 = createButton('Mensaje');
fortuneButton4.position(870,130);
// Call repaint() when the button is pressed.
fortuneButton4.mousePressed(pickFortune);
// Create a button and place it beneath the canvas.
let fortuneButton5 = createButton('Mensaje');
fortuneButton5.position(760,120);
// Call repaint() when the button is pressed.
fortuneButton5.mousePressed(pickFortune);
// Create a button and place it beneath the canvas.
let fortuneButton6 = createButton('Mensaje');
fortuneButton6.position(660,110);
// Call repaint() when the button is pressed.
fortuneButton6.mousePressed(pickFortune);
}
function draw() {
image(fondo, 0, 0, width, height, 0, 0, fondo.width, fondo.height, COVER);
image(haba,5,160,150,190);
image(caballero,170,150,80,100);
image(estelar,280,150,70,90);
image(pallares,860,150,110,130);
image(cisne,750,150,90,110);
image(arveja,650,150,90,90);
image(muchos,400,350,250,250);
fill(255)
textStyle(BOLD);
textFont('Courier New');
textSize(21);
fill(255);
stroke(0);
strokeWeight(4);
textAlign(CENTER, CENTER);
text(currentFortune, 500, 250)
;
}
// Change the background color.
function pickFortune() {
currentFortune = random(fortunes)
}