在上一篇的基础上
1、新增流星雨对象
//流星
var
MeteorRain
=
function
(
)
{
this
.
x
=
-1
;
this
.
y
=
-1
;
this
.
length
=
-1
;
//长度
this
.
angle
=
30
;
//倾斜角度
this
.
width
=
-1
;
//宽度
this
.
height
=
-1
;
//高度
this
.
speed
=
1
;
//速度
this
.
offset_x
=
-1
;
//横轴移动偏移量
this
.
offset_y
=
-1
;
//纵轴移动偏移量
this
.
alpha
=
1
;
//透明度
this
.
color1
=
""
;
//流星的色彩
this
.
color2
=
""
;
//流星的色彩
/****************初始化函数********************/
this
.
init
=
function
(
)
//初始化
{
this
.
getPos
(
)
;
this
.
alpha
=
1
;
//透明度
this
.
getRandomColor
(
)
;
//最小长度,最大长度
var
x
=
Math
.
random
(
)
*
80
+
150
;
this
.
length
=
Math
.
ceil
(
x
)
;
// x = Math.random()*10+30;
this
.
angle
=
30
;
//流星倾斜角
x
=
Math