Adjust puddle spawn; adjust velocity decrease
This commit is contained in:
parent
427b6af5b5
commit
bab941e94c
|
@ -29,8 +29,10 @@ export class PlayerEntity extends Entity {
|
||||||
this.puddleTimer += delta
|
this.puddleTimer += delta
|
||||||
if (this.puddleTimer >= 600) {
|
if (this.puddleTimer >= 600) {
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
ctx.addEntity(new PuddleEntity('effects.water.ripple.small.0'), this.x, this.y)
|
let p = this.position
|
||||||
console.log('add ripple')
|
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
|
this.puddleTimer = 0
|
||||||
}
|
}
|
||||||
|
@ -108,8 +110,8 @@ export class PlayerEntity extends Entity {
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
this.velocity[0] *= 0.5
|
this.velocity[0] *= 0.7
|
||||||
this.velocity[1] *= 0.5
|
this.velocity[1] *= 0.7
|
||||||
|
|
||||||
// Eh... let's manually handle velocity
|
// Eh... let's manually handle velocity
|
||||||
this.body?.setLinearVelocity(planck.Vec2(this.velocity[0], this.velocity[1]))
|
this.body?.setLinearVelocity(planck.Vec2(this.velocity[0], this.velocity[1]))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user