diff options
-rw-r--r-- | main.go | 11 | ||||
-rw-r--r-- | objects.go | 4 |
2 files changed, 9 insertions, 6 deletions
@@ -164,15 +164,16 @@ func (g *Game) Init() { func (g *Game) Update() error { g.time += 1 - if inpututil.IsKeyJustPressed(ebiten.KeyR) { + if ebiten.IsKeyPressed(ebiten.KeyR) { + if g.state == IN_GAME { + g.state = REVERSING + g.shaderName = "vcr" + } + } else { if g.state == REVERSING { g.state = IN_GAME g.shaderName = "none" - } else if g.state == IN_GAME { - g.state = REVERSING - g.shaderName = "vcr" } - } if g.state == IN_GAME { @@ -225,7 +225,9 @@ func OnCollideSpring(this, other *GameObject) bool { } func OnCollideSpike(this, other *GameObject) bool { - other.game.ResetAll() + if other == this.game.player { + other.game.ResetAll() + } return true } |