File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ var frame_objects=[]
9
9
var all_connecters = [ ]
10
10
var all_tops = [ ]
11
11
var all_bottoms = [ ]
12
- var len = 300
12
+ var len = 200
13
13
for ( let i = 0 ; i < len ; i ++ ) {
14
14
var pos_x = - len + i * 30
15
15
var x = Math . PI / 2 * i / 3
@@ -41,17 +41,17 @@ tops = two.makeGroup(all_tops)
41
41
connecters = two . makeGroup ( all_connecters )
42
42
bottoms = two . makeGroup ( all_bottoms )
43
43
console . log ( connecters . getBoundingClientRect ( ) ) ;
44
- var n = 0
44
+ var n = 1
45
45
var target = 12
46
46
two . bind ( 'update' , function ( frameCount ) {
47
- if ( frameCount % 20 == 0 ) {
48
- // tops.translation.x+=n& target?30:-target*30
49
- // bottoms.translation.x+=n< target?30:-30* target
50
- // connecters.translation.x+=n< target?30:-30* target
51
- console . log ( target ) ;
47
+ if ( frameCount % 5 == 0 ) {
48
+ tops . translation . x += n % target ?30 :- target * 30
49
+ bottoms . translation . x += n % target ?30 :- target * 30
50
+ connecters . translation . x += n % target ?30 :- target * 30
51
+ // console.log(n );
52
52
n ++
53
- if ( n == target ) {
54
- n = 0
53
+ if ( n == target + 1 ) {
54
+ n = 1
55
55
}
56
56
}
57
57
} ) . play ( ) ; // Finally, start the animation loop
You can’t perform that action at this time.
0 commit comments