Skip to content

Commit 6c362be

Browse files
author
Lauren McCarthy
committed
Merge branch 'master' of github.com:processing/p5.js-website
2 parents 5a64e6d + 4b697bd commit 6c362be

File tree

5 files changed

+60
-33
lines changed

5 files changed

+60
-33
lines changed

.github/issue_template.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
**Actual Behaviour**
2+
3+
<!--Please state here what is currently happening.-->
4+
5+
**Expected Behaviour**
6+
7+
<!--State here what the feature should enable the user to do.-->
8+
9+
**Steps to reproduce it**
10+
11+
<!--Add steps to reproduce bugs or add information on the place where the feature should be implemented. Add links to a sample deployment or code.-->
12+
13+
**Screenshots of the issue**
14+
15+
<!--Where-ever possible attach a screenshot of the issue.-->
16+
17+
**Would you like to work on the issue?**
18+
19+
<!--Please let us know if you can work on it or the issue should be assigned to someone else.-->

.github/pull_request_template.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Fixes #[Add issue number here]
2+
3+
Changes:
4+
<!-- Add here what changes were made in this pull request and if possible provide links showcasing the changes. -->
5+
6+
7+
Screenshots of the change:
8+
<!-- Add screenshots depicting the changes. -->

src/data/examples/en/13_Motion/04_Bouncy_Bubbles.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class Ball {
3838
constructor(xin, yin, din, idin, oin) {
3939
this.x = xin;
4040
this.y = yin;
41-
let vx = 0;
42-
let vy = 0;
41+
this.vx = 0;
42+
this.vy = 0;
4343
this.diameter = din;
4444
this.id = idin;
4545
this.others = oin;
@@ -61,31 +61,31 @@ class Ball {
6161
let targetY = this.y + sin(angle) * minDist;
6262
let ax = (targetX - this.others[i].x) * spring;
6363
let ay = (targetY - this.others[i].y) * spring;
64-
vx -= ax;
65-
vy -= ay;
64+
this.vx -= ax;
65+
this.vy -= ay;
6666
this.others[i].vx += ax;
6767
this.others[i].vy += ay;
6868
}
6969
}
7070
}
7171

7272
move() {
73-
vy += gravity;
74-
this.x += vx;
75-
this.y += vy;
73+
this.vy += gravity;
74+
this.x += this.vx;
75+
this.y += this.vy;
7676
if (this.x + this.diameter / 2 > width) {
7777
this.x = width - this.diameter / 2;
78-
vx *= friction;
78+
this.vx *= friction;
7979
} else if (this.x - this.diameter / 2 < 0) {
8080
this.x = this.diameter / 2;
81-
vx *= friction;
81+
this.vx *= friction;
8282
}
8383
if (this.y + this.diameter / 2 > height) {
8484
this.y = height - this.diameter / 2;
85-
vy *= friction;
85+
this.vy *= friction;
8686
} else if (this.y - this.diameter / 2 < 0) {
8787
this.y = this.diameter / 2;
88-
vy *= friction;
88+
this.vy *= friction;
8989
}
9090
}
9191

src/data/examples/es/13_Motion/04_Bouncy_Bubbles.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class Ball {
3838
constructor(xin, yin, din, idin, oin) {
3939
this.x = xin;
4040
this.y = yin;
41-
let vx = 0;
42-
let vy = 0;
41+
this.vx = 0;
42+
this.vy = 0;
4343
this.diameter = din;
4444
this.id = idin;
4545
this.others = oin;
@@ -61,31 +61,31 @@ class Ball {
6161
let targetY = this.y + sin(angle) * minDist;
6262
let ax = (targetX - this.others[i].x) * spring;
6363
let ay = (targetY - this.others[i].y) * spring;
64-
vx -= ax;
65-
vy -= ay;
64+
this.vx -= ax;
65+
this.vy -= ay;
6666
this.others[i].vx += ax;
6767
this.others[i].vy += ay;
6868
}
6969
}
7070
}
7171

7272
move() {
73-
vy += gravity;
74-
this.x += vx;
75-
this.y += vy;
73+
this.vy += gravity;
74+
this.x += this.vx;
75+
this.y += this.vy;
7676
if (this.x + this.diameter / 2 > width) {
7777
this.x = width - this.diameter / 2;
78-
vx *= friction;
78+
this.vx *= friction;
7979
} else if (this.x - this.diameter / 2 < 0) {
8080
this.x = this.diameter / 2;
81-
vx *= friction;
81+
this.vx *= friction;
8282
}
8383
if (this.y + this.diameter / 2 > height) {
8484
this.y = height - this.diameter / 2;
85-
vy *= friction;
85+
this.vy *= friction;
8686
} else if (this.y - this.diameter / 2 < 0) {
8787
this.y = this.diameter / 2;
88-
vy *= friction;
88+
this.vy *= friction;
8989
}
9090
}
9191

src/data/examples/zh-Hans/13_Motion/04_Bouncy_Bubbles.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class Ball {
3838
constructor(xin, yin, din, idin, oin) {
3939
this.x = xin;
4040
this.y = yin;
41-
let vx = 0;
42-
let vy = 0;
41+
this.vx = 0;
42+
this.vy = 0;
4343
this.diameter = din;
4444
this.id = idin;
4545
this.others = oin;
@@ -61,31 +61,31 @@ class Ball {
6161
let targetY = this.y + sin(angle) * minDist;
6262
let ax = (targetX - this.others[i].x) * spring;
6363
let ay = (targetY - this.others[i].y) * spring;
64-
vx -= ax;
65-
vy -= ay;
64+
this.vx -= ax;
65+
this.vy -= ay;
6666
this.others[i].vx += ax;
6767
this.others[i].vy += ay;
6868
}
6969
}
7070
}
7171

7272
move() {
73-
vy += gravity;
74-
this.x += vx;
75-
this.y += vy;
73+
this.vy += gravity;
74+
this.x += this.vx;
75+
this.y += this.vy;
7676
if (this.x + this.diameter / 2 > width) {
7777
this.x = width - this.diameter / 2;
78-
vx *= friction;
78+
this.vx *= friction;
7979
} else if (this.x - this.diameter / 2 < 0) {
8080
this.x = this.diameter / 2;
81-
vx *= friction;
81+
this.vx *= friction;
8282
}
8383
if (this.y + this.diameter / 2 > height) {
8484
this.y = height - this.diameter / 2;
85-
vy *= friction;
85+
this.vy *= friction;
8686
} else if (this.y - this.diameter / 2 < 0) {
8787
this.y = this.diameter / 2;
88-
vy *= friction;
88+
this.vy *= friction;
8989
}
9090
}
9191

0 commit comments

Comments
 (0)