Skip to content

Commit 5578c6f

Browse files
Courssumm02Courssumm02
authored andcommitted
M7
1 parent 225e132 commit 5578c6f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Module Extra 7/app.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var frame_objects=[]
99
var all_connecters=[]
1010
var all_tops=[]
1111
var all_bottoms=[]
12-
var len = 300
12+
var len = 200
1313
for (let i = 0; i < len; i++){
1414
var pos_x = -len+i*30
1515
var x = Math.PI/2*i/3
@@ -41,17 +41,17 @@ tops = two.makeGroup(all_tops)
4141
connecters = two.makeGroup(all_connecters)
4242
bottoms = two.makeGroup(all_bottoms)
4343
console.log(connecters.getBoundingClientRect());
44-
var n = 0
44+
var n = 1
4545
var target=12
4646
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);
5252
n++
53-
if (n==target){
54-
n=0
53+
if (n==target+1){
54+
n=1
5555
}
5656
}
5757
}).play(); // Finally, start the animation loop

0 commit comments

Comments
 (0)