Created
October 21, 2017 01:15
-
-
Save TRNT7/d9452b27cb18d06dce9be07591cdde1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- PLEASE NO CHANGES BELOW THIS LINE (UNTIL I SAY SO) --> | |
<script language="javascript" type="text/javascript" src="libraries/p5.js"></script> | |
<script language="javascript" type="text/javascript" src="SpinnerXjson.js"></script> | |
<!-- OK, YOU CAN MAKE CHANGES BELOW THIS LINE AGAIN --> | |
<!-- This line removes any default padding and style. | |
You might only need one of these values set. --> | |
<style> body {padding: 0; margin: 0;} </style> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment