Skip to content

Instantly share code, notes, and snippets.

@davidedc
Created March 18, 2016 17:09
Show Gist options
  • Save davidedc/7a3df3abe371907687ca to your computer and use it in GitHub Desktop.
Save davidedc/7a3df3abe371907687ca to your computer and use it in GitHub Desktop.
Sorry guys I reeeeeally borked your playground by doing the stuff below, here are some of my shenanigans:
OK I added the class turtle to rabbit:
el = document.getElementById("rabbit");
el.className = "turtle";
Some other tries:
setInterval(function(){ var colors = ['#ff0000', '#00ff00', '#0000ff'];var random_color = colors[Math.floor(Math.random() * colors.length)]; Howard.fill(random_color);}, 300);
setInterval(function(){ var random_color = '#' + Math.random().toString(16).slice(2, 8); Ella.fill(random_color);}, 300);
setInterval(function(){ var random_color = '#' + Math.random().toString(16).slice(2, 8); Ella.strokeColor(random_color);}, 30);
setInterval(function(){ Ella.strokeWidth(Math.floor((Math.random() * 10) + 1));}, 30);
setInterval(function(){ Brian.scale(Math.floor((Math.random() * 3) + 1));}, 30);
// ops I lost Bryan
// this is more in control
setInterval(function(){ Andre.scale(Math.random() - 0.5);}, 30);
setInterval(function(){ Jennie.path.rotate(20 * (Math.random() - 0.5));}, 30);
setInterval(function(){ Jennie.path.setPosition(new paper.Point(Math.random()*10,Math.random()*10));}, 300);
// this reeeeeeeeally broke things big time
var center = new paper.Point(50, 50);
var points = 12;
var radius1 = 25;
var radius2 = 40;
var starPath = new paper.Path.Star(center, points, radius1, radius2);
starPath.fillColor = 'yellow';
"yellow"
Marvin.path = starPath;
@davidedc
Copy link
Author

also this:

setInterval(
  function(){
var center = new paper.Point(Math.random()*window.innerWidth, Math.random()*window.innerHeight);
var points = Math.floor(Math.random()*12);
var radius1 = Math.floor(Math.random()*25);
var radius2 = Math.floor(Math.random()*40);
var path = new paper.Path.Star(center, points, radius1, radius2);
var random_color = '#' + Math.random().toString(16).slice(2, 8);
path.fillColor = random_color;
path.moveTo(new paper.Point(Math.random()*window.innerWidth,Math.random()*window.innerHeight))
  }
 , 30);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment