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 | |
parent | eeed424b99210c4e436df1b40a0dace9897619a1 (diff) |
Tweak wait time
-rw-r--r-- | assets/ambient.ogg | bin | 4605681 -> 4605365 bytes | |||
-rw-r--r-- | assets/land1.ogg | bin | 7658 -> 7072 bytes | |||
-rw-r--r-- | assets/land2.ogg | bin | 6857 -> 6368 bytes | |||
-rw-r--r-- | level.go | 5 | ||||
-rw-r--r-- | main.go | 11 | ||||
-rw-r--r-- | objects.go | 6 |
6 files changed, 9 insertions, 13 deletions
diff --git a/assets/ambient.ogg b/assets/ambient.ogg Binary files differindex b858738..d2bf7f1 100644 --- a/assets/ambient.ogg +++ b/assets/ambient.ogg diff --git a/assets/land1.ogg b/assets/land1.ogg Binary files differindex 6c71e18..10fb8a5 100644 --- a/assets/land1.ogg +++ b/assets/land1.ogg diff --git a/assets/land2.ogg b/assets/land2.ogg Binary files differindex af70def..58b0785 100644 --- a/assets/land2.ogg +++ b/assets/land2.ogg @@ -1,9 +1,5 @@ package main -import ( - "fmt" -) - func StartGame(g *Game) { //g.state = IN_GAME g.player = NewPlayer(g, 4 * tileSize, 9 * tileSize) @@ -17,7 +13,6 @@ func StartGame(g *Game) { func PauseScreen(g *Game) { g.SetPaused() - fmt.Printf("PAUSE\n", 0, len(g.playerAi)) } func ReverseLevel(g *Game) { @@ -33,9 +33,9 @@ const ( friction = 0.75 airResistance = 0.98 - endCardDuration = 200 + endCardDuration = 240 - exitTransitionWeight = 0.8 + exitTransitionWeight = 0.7 ghostAlpha = 0.5 hightlightBorder = 2 audioFadeIn = 0.999 @@ -43,6 +43,7 @@ const ( sampleRate = 44100 shadowOffset = 1 + killPlayerAfter = 80 musicLoopLength = 230 menuFadeInTime = 80 @@ -229,7 +230,7 @@ func (g * Game)ReplayPlayerAi() { } g.playerAiIdx += 1 - if g.playerAiIdx >= len(g.playerAi) * 2 { + if g.playerAiIdx >= len(g.playerAi) + killPlayerAfter { g.KillPlayer() } @@ -290,7 +291,7 @@ func (g *Game) Update() error { } if inpututil.IsMouseButtonJustReleased(ebiten.MouseButton0) { bo = buttonOffset - if onButton { + if onButton && g.animStart <= 0{ g.animStart = g.time + 60 StartGame(g) } @@ -445,7 +446,7 @@ func (g *Game) PlaceObject(cx, cy int) { g.objects = append(g.objects, placeable) g.toPlace = g.toPlace[1:len(g.toPlace)] - + placeable.PlayLand() if len(g.toPlace) == 0 && len(g.playerAi) == 0 { g.TransitionState() } @@ -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() |