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 | ||||
|       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])) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user