diff options
author | davidovski <david@davidovski.xyz> | 2024-04-23 15:07:17 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2024-04-23 15:07:17 +0100 |
commit | c73792133fafc80763297f99a6ca8ff28c2c43cb (patch) | |
tree | e2662db8001f8cf94311327aac0ff4e07214ed15 /objects.go | |
parent | eeed424b99210c4e436df1b40a0dace9897619a1 (diff) |
Tweak wait time
Diffstat (limited to 'objects.go')
-rw-r--r-- | objects.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -159,8 +159,8 @@ func (o * GameObject) Update(tilemap Tilemap, others []*GameObject) { } if o.HasCollision(tilemap, others, direction) { - if ! o.onGround && o.vy > gravity*1210 { - o.playLand() + if ! o.onGround && o.vy > gravity*12 { + o.PlayLand() } o.onGround = true; o.vx *= o.friction @@ -264,7 +264,7 @@ func (object * GameObject) Collide(other *GameObject) bool { return ! ( minX2 >= maxX1 || maxX2 <= minX1 || minY2 >= maxY1 || maxY2 <= minY1) } -func (object *GameObject) playLand() { +func (object *GameObject) PlayLand() { jumpid := rand.IntN(2) object.game.audioPlayer.landAudio[jumpid].Rewind() object.game.audioPlayer.landAudio[jumpid].Play() |