xxxxxxxxxx
65
//EE start with the "click" of the arduino
var botonOne;
var stepOne = true;
var hhOne ;
function setup() {
createCanvas(windowWidth, windowHeight);
//This graphic is gone once we have arduino
botonOne = createButton("Press to Start");
botonOne.position(width/2,5);
//Will need to substitute 8-11 with the arduino event
botonOne.mousePressed(theyPushed);
}
function draw() {
if (stepOne) {
background(0);
ellipse (200,200,50,50);
} else {
clear();
gotBadN();
}
}
function theyPushed() {
stepOne = !stepOne;
badNews();
}
function badNews() {
// URL for querying the times
var urlBad = 'https://api.nytimes.com/svc/topstories/v2/world.json'+'?api-key=a65aff26acee41528286255c6b07c42b';
loadJSON(urlBad, gotBadN);
}
//EE Start writtin
function gotBadN(badN){
//console.log(badN);
for (var i = 0; i < badN.results.length; i++) {
//println (badN.results[i].title);
println (badN.results[random].title);
hhOne= badN.results[i].title;
//The circle is drawing here, but not the text from the println HY
//Would make it a class help me create it and move it?
createElement();
ellipse (0,200,50,50);
createP("Sirve");
//createElement('h1', noticias.results[i].title);
}
}
//Keep on writting on the screen (make them fall)
//EE Start the distopian mp3
//EE After a certain time show the "You can stop this" and red button to next step
//EE Show "Stand on the circle with someone else for 10 seconds"
//EE When serial sends the signal of people standing start countdown
// Dim music
//EE Change image
//make the event of the swich from Arduino and the coutdown¿¿