Skip to content

Commit 4e3e4d5

Browse files
mihailgaberovmihailgaberov
mihailgaberov
authored and
mihailgaberov
committed
💄 Fine tuning the animation.
1 parent 4718182 commit 4e3e4d5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

index.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,18 @@ export default class App {
127127
const onRenderTick = () => {
128128
balls.forEach(ball => {
129129
if (ball.position.y >= render.canvas.height - 100) {
130-
Body.applyForce(ball, { x: ball.position.x, y: ball.position.y }, { x: 0.01, y: -0.01 })
130+
Body.applyForce(ball, { x: ball.position.x, y: ball.position.y }, { x: 0.003, y: -0.003 })
131131
}
132132
if (ball.position.y < 120) {
133-
Body.applyForce(ball, { x: ball.position.x, y: ball.position.y }, { x: -0.01, y: 0.01 })
133+
Body.applyForce(ball, { x: ball.position.x, y: ball.position.y }, { x: -0.003, y: 0.003 })
134134
}
135135

136136
if (ball.position.x < 80) {
137-
Body.applyForce(ball, { x: ball.position.x, y: ball.position.y }, { x: 0.01, y: -0.01 })
137+
Body.applyForce(ball, { x: ball.position.x, y: ball.position.y }, { x: 0.003, y: -0.003 })
138138
}
139139

140140
if (ball.position.x > render.canvas.width - 80) {
141-
Body.applyForce(ball, { x: ball.position.x, y: ball.position.y }, { x: -0.01, y: 0.01 })
141+
Body.applyForce(ball, { x: ball.position.x, y: ball.position.y }, { x: -0.003, y: 0.003 })
142142
}
143143
})
144144
}
@@ -182,14 +182,15 @@ export default class App {
182182
addRect({
183183
x: cx2,
184184
y: cy2,
185-
w: 10 / 1000 * m,
186-
h: 300 / 1000 * m,
185+
w: 100 / 1000 * m,
186+
h: 3000 / 1000 * m,
187187
options: {
188188
angle: angle2,
189189
isStatic: true,
190190
density: 1,
191191
render: {
192-
fillStyle: 'red',
192+
fillStyle: 'transparent',
193+
strokeStyle: 'white',
193194
lineWidth: 0
194195
}
195196
}

0 commit comments

Comments
 (0)