1
0
Fork 0
mirror of https://github.com/mat-1/matdoesdev.git synced 2025-08-02 14:46:04 +00:00

fix floor physics

This commit is contained in:
mat 2024-04-13 21:01:23 +00:00
parent 0a6d90717a
commit 0ae90b413a
2 changed files with 3 additions and 3 deletions

View file

@ -13,9 +13,9 @@ export function initGravity(): () => void {
const floorBody = Bodies.rectangle(
window.innerWidth / 2,
window.innerHeight - 5,
window.innerHeight + 50,
window.innerWidth,
10,
100,
{
isStatic: true,
}

View file

@ -32,7 +32,7 @@
pathChangeTimestamps.push(Date.now())
while (pathChangeTimestamps[0] < Date.now() - 5000) pathChangeTimestamps.shift()
console.log(pathChangeTimestamps)
if (pathChangeTimestamps.length >= 10) {
if (pathChangeTimestamps.length >= 1) {
const { initGravity } = await import('$lib/gravity')
// wait 200ms for the animation to finish
await new Promise((resolve) => setTimeout(resolve, 200))