Particle System + Attractors
Last active
December 18, 2015 09:49
-
-
Save foldi/5764325 to your computer and use it in GitHub Desktop.
FloraJS - Particle System + Attractors
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
<title>FloraJS | Simulate natural systems with JavaScript</title> | |
<link rel="stylesheet" href="http://www.florajs.com/demos/css/burner.min.css" type="text/css" charset="utf-8" /> | |
<link rel="stylesheet" href="http://www.florajs.com/demos/css/flora.min.css" type="text/css" charset="utf-8" /> | |
<script src="http://www.florajs.com/demos/scripts/burner.min.js" type="text/javascript" charset="utf-8"></script> | |
<script src="http://www.florajs.com/demos/scripts/flora.min.js" type="text/javascript" charset="utf-8"></script> | |
</head> | |
<body> | |
<script type="text/javascript" charset="utf-8"> | |
Burner.System.init(function() { | |
this.add('ParticleSystem', { | |
lifespan: -1, | |
startColor: [255, 255, 255], | |
particleOptions: { | |
maxSpeed: 3 | |
} | |
}); | |
this.add('Attractor', { | |
draggable: true, | |
location: function () { | |
return new Burner.Vector(this.world.width / 2 - 120, this.world.height / 2 - 120); | |
} | |
}); | |
this.add('Attractor', { | |
draggable: true, | |
location: function () { | |
return new Burner.Vector(this.world.width / 2 + 120,this.world.height / 2 + 120); | |
} | |
}); | |
this.add('Caption', { | |
text: 'Particle System and Attractors: drag attactors to affect particle system', | |
opacity: 0.4, | |
borderColor: 'transparent', | |
position: 'top center' | |
}); | |
this.add('InputMenu', { | |
opacity: 0.4, | |
borderColor: 'transparent', | |
position: 'bottom center' | |
}); | |
}, { | |
gravity: new Burner.Vector(0, 0), | |
c: 0 | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment