summaryrefslogtreecommitdiff
path: root/objects.go
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2024-04-23 15:07:17 +0100
committerdavidovski <david@davidovski.xyz>2024-04-23 15:07:17 +0100
commitc73792133fafc80763297f99a6ca8ff28c2c43cb (patch)
treee2662db8001f8cf94311327aac0ff4e07214ed15 /objects.go
parenteeed424b99210c4e436df1b40a0dace9897619a1 (diff)
Tweak wait time
Diffstat (limited to 'objects.go')
-rw-r--r--objects.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/objects.go b/objects.go
index 141bf65..aca9209 100644
--- a/objects.go
+++ b/objects.go
@@ -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()