Skip to content

Commit 63f312f

Browse files
committed
fix: acceleration to be positive integer
1 parent eb1c1c6 commit 63f312f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/packlets/playground/balloon.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
export let size: number = 150
1212
export let horizontal: number = 0
1313
export let vertical: number | undefined
14-
export let acceleration = -6 // px/s^2
14+
export let acceleration = 6 // px/s^2
1515
1616
const colors = [
1717
'text-น้ำครั่ง',
@@ -40,7 +40,7 @@
4040
const distance = 0.5 * acceleration * time ** 2
4141
4242
// calculate new height based on initial height and distance, would fly up
43-
currentHeight = currentHeight + distance
43+
currentHeight = currentHeight - distance
4444
4545
// stop when it overshoots viewport height
4646
if (-currentHeight - size * 2 > window.innerHeight) {

0 commit comments

Comments
 (0)