From bab941e94c19a9ea8ab9921cd4178d0dd8921cbd Mon Sep 17 00:00:00 2001 From: kts of kettek Date: Sat, 29 Jan 2022 22:13:35 -0800 Subject: [PATCH] Adjust puddle spawn; adjust velocity decrease --- Engine/src/live/PlayerEntity.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Engine/src/live/PlayerEntity.ts b/Engine/src/live/PlayerEntity.ts index d67546d..1b977ec 100644 --- a/Engine/src/live/PlayerEntity.ts +++ b/Engine/src/live/PlayerEntity.ts @@ -29,8 +29,10 @@ export class PlayerEntity extends Entity { this.puddleTimer += delta if (this.puddleTimer >= 600) { if (ctx) { - ctx.addEntity(new PuddleEntity('effects.water.ripple.small.0'), this.x, this.y) - console.log('add ripple') + let p = this.position + p[0] += (this.sprite.frame?.originX??0) + ((this.sprite.frame?.width??0)/2??0) + p[1] += (this.sprite.frame?.originY??0) + ((this.sprite.frame?.height??0)/2??0) + ctx.addEntity(new PuddleEntity('effects.water.ripple.small.0'), 'ground', p[0], p[1]) } this.puddleTimer = 0 } @@ -108,8 +110,8 @@ export class PlayerEntity extends Entity { } // - this.velocity[0] *= 0.5 - this.velocity[1] *= 0.5 + this.velocity[0] *= 0.7 + this.velocity[1] *= 0.7 // Eh... let's manually handle velocity this.body?.setLinearVelocity(planck.Vec2(this.velocity[0], this.velocity[1]))