|
|
@@ -3,6 +3,8 @@ var randomInt = function (min, max) {
|
|
3
|
3
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
4
|
4
|
}
|
|
5
|
5
|
|
|
|
6
|
+var randomColor;
|
|
|
7
|
+
|
|
6
|
8
|
window.onload = function()
|
|
7
|
9
|
{
|
|
8
|
10
|
// lets git the HTML canvas element so we draw on it
|
|
|
@@ -35,9 +37,9 @@ window.onload = function()
|
|
35
|
37
|
this.height = 20;
|
|
36
|
38
|
|
|
37
|
39
|
//random colors for our box
|
|
38
|
|
- /*this.r = Math.round(Math.random()*255);
|
|
|
40
|
+ this.r = Math.round(Math.random()*255);
|
|
39
|
41
|
this.g = Math.round(Math.random()*255);
|
|
40
|
|
- this.b = Math.round(Math.random()*255);*/
|
|
|
42
|
+ this.b = Math.round(Math.random()*255);
|
|
41
|
43
|
|
|
42
|
44
|
this.randomColor = randomInt(0,colorsArray.colors.length-1);
|
|
43
|
45
|
this.r = colorsArray.colors[this.randomColor].red;
|