@@ -45,7 +45,10 @@ var circlePath = new Path.Circle({
45
45
center : [ 0 , 0 ] ,
46
46
radius : 10 ,
47
47
fillColor : 'white' ,
48
- strokeColor : 'white'
48
+ strokeColor : 'white' ,
49
+ shadowColor : 'cyan' ,
50
+ shadowBlur : 10 ,
51
+ shadowOffset : [ ( Math . floor ( Math . random ( ) * 4 ) - 2 ) , ( Math . floor ( Math . random ( ) * 4 ) - 2 ) ]
49
52
} ) ;
50
53
51
54
var symbol = new Symbol ( circlePath ) ;
@@ -57,7 +60,8 @@ for (var i = 0; i < count; i++) {
57
60
var placedSymbol = symbol . place ( center ) ;
58
61
// placedSymbol.fillColor.hue += (Math.random() * 8)
59
62
placedSymbol . scale ( i / count ) ;
60
- placedSymbol . direction = 2 * Math . PI * Math . random ( )
63
+ placedSymbol . direction = 2 * Math . PI * Math . random ( ) ;
64
+ if ( i === 50 ) console . log ( placedSymbol ) ;
61
65
}
62
66
63
67
// The onFrame function is called up to 60 times a second:
@@ -67,14 +71,12 @@ function onFrame(event) {
67
71
for ( var i = 0 ; i < count ; i ++ ) {
68
72
var item = project . activeLayer . children [ i ] ;
69
73
70
- // Move the item 1/20th of its width to the right . This way
74
+ // Move the item 1/20th of its width in the direction of its motion . This way
71
75
// larger circles move faster than smaller circles:
72
76
var speed = item . bounds . width / 30 ;
73
77
item . position . x += Math . cos ( item . direction ) * speed ;
74
78
item . position . y += Math . sin ( item . direction ) * speed ;
75
79
76
- //item.position.x += item.bounds.width / 20;
77
-
78
80
// If the item has left the view on the right, move it back
79
81
// to the left:
80
82
if ( item . bounds . left > view . size . width ) {
0 commit comments