Skip to content

Commit 71b4006

Browse files
Courssumm02Courssumm02
authored andcommitted
M7
1 parent 5578c6f commit 71b4006

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

Images/m1_1.PNG

36.8 KB
Loading

Module Extra 7/app.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ var frame_objects=[]
99
var all_connecters=[]
1010
var all_tops=[]
1111
var all_bottoms=[]
12-
var len = 200
12+
var len = 250
1313
for (let i = 0; i < len; i++){
14-
var pos_x = -len+i*30
14+
var pos_x = -len+i*30 -40
1515
var x = Math.PI/2*i/3
16-
var dist = 80
16+
var dist = 60
1717
var up = Math.round(Math.sin(x)*dist)
1818
var down = -Math.round(Math.sin(x)*dist)
1919
var connecter = two.makeRectangle(pos_x,300,10,up*2)
@@ -22,32 +22,32 @@ for (let i = 0; i < len; i++){
2222
connecter.linewidth=3
2323
var size1 = 10//(up/40 + 10)/1
2424
var size2 = 10//(down/40 + 10)/1
25-
var circle_top = two.makeCircle(pos_x, 300 + up, size1)
26-
circle_top.fill = "red"
27-
circle_top.stroke = "darkred"
28-
circle_top.linewidth = 3
2925
var circle_bottom = two.makeCircle(pos_x, 300 + down, size2)
3026
circle_bottom.fill = "orange"
3127
circle_bottom.stroke = "#cc5500"
3228
circle_bottom.linewidth = 3
29+
var circle_top = two.makeCircle(pos_x, 300 + up, size1)
30+
circle_top.fill = "red"
31+
circle_top.stroke = "darkred"
32+
circle_top.linewidth = 3
3333
// frame_objects.push(connecter, circle_top, circle_bottom)
3434
all_connecters.push(connecter)
3535
all_tops.push(circle_top)
3636
all_bottoms.push(circle_bottom)
3737
}
3838
// var group = two.makeGroup(frame_objects)
3939

40-
tops = two.makeGroup(all_tops)
4140
connecters = two.makeGroup(all_connecters)
41+
tops = two.makeGroup(all_tops)
4242
bottoms = two.makeGroup(all_bottoms)
4343
console.log(connecters.getBoundingClientRect());
4444
var n = 1
4545
var target=12
4646
two.bind('update', function(frameCount) {
47-
if (frameCount%5==0){
47+
if (frameCount%10==0){
48+
connecters.translation.x+=n%target?30:-target*30
4849
tops.translation.x+=n%target?30:-target*30
4950
bottoms.translation.x+=n%target?30:-target*30
50-
connecters.translation.x+=n%target?30:-target*30
5151
// console.log(n);
5252
n++
5353
if (n==target+1){

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Nature, In Code
2+
3+
This a repo contains the projects and code for the summer camp in Laussane.
4+
5+
## Photos:
6+
7+
### Module 1:
8+
![Module 1 Image](./Images/md1_1.PNG)

0 commit comments

Comments
 (0)