Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var positions =[];
- var Hello = {
- you: "good",
- weather: "today?",
- status: undefined
- };
- function setup() {
- createCanvas(windowWidth, windowHeight);
- console.log(Hello);
- }
- function draw() {
- background(0,20);
- push();
- translate(mouseX,mouseY);
- rectMode(CENTER);
- rect(0,0,70,70);
- fill(42,171,229);
- noStroke();
- pop();
- // draw of the achorded phidgets
- for (var i = 0; i < positions.length; i++) {
- push();
- noStroke();
- fill(positions[i].colour);
- translate(positions[i].x, positions[i].y);
- rotate(positions[i].rotation);
- rect(0,0,positions[i].size, positions[i].size);
- positions[i].rotation += positions[i].rotationrate;
- pop();
- }
- }
- function mouseClicked(){
- var mousedata =
- {
- x : mouseX ,
- y : mouseY,
- size : 50,
- rotation:0,
- rotationrate: frameCount/70,
- colour: "#F29DF2"
- };
- var now = new Date();
- saveJSON(Hello, "Flowers"+ now);
- positions.push(mousedata);
- console.log(mousedata);
- }
Add Comment
Please, Sign In to add comment