snow pre development

by Lucille Kenney

HTML

<canvas id="canvas" width="300" height="300"></canvas>

CSS

canvas{border:1px solid black;}

JavaScript

var canvas = $("#canvas");
var context =canvas.get(0).getContext("2d");

function particle()
{
     this.x = Math.random()*canvas.width();
     this.y = Math.random()*canvas.height();
     this.width = Math.random()*20 + 5;
     this.height = this.width;
     this.color = "red";
    
    this.draw = function(){
        context.fillStyle = this.color;
        context.fillRect(this.x, this.y, this.width, this.height);
    }
}

var mySquares = [];

for(var i = 0; i < 100; i++)
{
     mySquares[i] = new    
}