var Vector = function(x, y) {
this.x = x;
this.y = y;
};
var location = new Vector(10, 10);
var velocity = new Vector(1, 3);
location.x += velocity.x;
location.y += velocity.y;
// Motion!
var Particle = function(x, y) {
this.position = new Vector(x, y);
this.velocity = new Vector();
this.acceleration = new Vector();
this.size = 1;
this.fillStyle = "#fff";
};
Particle.prototype = {
draw: function(context) {
// Whatever you want it to look like here!
context.fillStyle = this.fillStyle;
context.fillRect(this.position.x, this.position.y, this.size, this.size);
}
};
function applyForce(force) {
force.div(mass);
acceleration.add(force);
}