using paper tadpoles crap !!!!!!
by Nick Hulea
HTML
<script src="http://aa8f47fcc01b7584f779-b57f388ffba74a9d5600392ce75da4b1.r13.cf2.rackcdn.com/paperjs-v0.9.18/dist/paper-full.js"></script>
<div class="canvas">
<canvas width="640" height="480" resize="true" id="canvas-1" style="background:black"></canvas>
<script type="text/paperscript" canvas="canvas-1">
// Adapted from Flocking Processing example by Daniel Schiffman:
// http://processing.org/learning/topics/flocking.html
var Boid = Base.extend({
initialize: function(position, maxSpeed, maxForce) {
var strength = Math.random() * 0.5;
this.acceleration = new Point();
this.vector = Point.random() * 2 - 1;
this.position = position.clone();
this.radius = 30;
this.maxSpeed = maxSpeed + strength;
this.maxForce = maxForce + strength;
this.amount = strength * 10 + 10;
this.count = 0;
this.createItems();
},
run: function(boids) {
this.lastLoc = this.position.clone();
if (!groupTogether) {
this.flock(boids);
} else {
this.align(boids);
}
this.borders();
this.update();
//this.calculateTail();
this.moveHead();
},
createItems: function() {
this.head = new Shape.Ellipse({
position: [0, 0],
size: [13, 8],
fillColor: 'white'
});
this.cloud = new Raster({
positon: this.head.position,
source: 'http://aa8f47fcc01b7584f779-b57f388ffba74a9d5600392ce75da4b1.r13.cf2.rackcdn.com/cloud_2.png'
});
this.path = new Path({
strokeColor: 'white',
strokeWidth:...