Skip to content

Commit

Permalink
nil selected dude on camera use
Browse files Browse the repository at this point in the history
  • Loading branch information
kettek committed Jun 29, 2024
1 parent ea3ab48 commit a6fd95f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/game/game.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,20 @@ func (g *Game) Update() error {

if ebiten.IsKeyPressed(ebiten.KeyQ) || ebiten.IsKeyPressed(ebiten.KeyLeft) || ebiten.IsKeyPressed(ebiten.KeyA) {
g.camera.SetRotationAt(g.camera.Rotation()-0.05, 1)
g.selectedDude = nil
} else if ebiten.IsKeyPressed(ebiten.KeyE) || ebiten.IsKeyPressed(ebiten.KeyRight) || ebiten.IsKeyPressed(ebiten.KeyD) {
g.camera.SetRotationAt(g.camera.Rotation()+0.05, 1)
g.selectedDude = nil
}

if inpututil.IsKeyJustPressed(ebiten.KeyW) || inpututil.IsKeyJustPressed(ebiten.KeyUp) {
if g.tower != nil && g.camera.Story() < len(g.tower.Stories)-2 {
g.camera.SetStory(g.camera.Story() + 1)
g.selectedDude = nil
}
} else if inpututil.IsKeyJustPressed(ebiten.KeyS) || inpututil.IsKeyJustPressed(ebiten.KeyDown) {
g.camera.SetStory(g.camera.Story() - 1)
g.selectedDude = nil
}

if inpututil.IsKeyJustPressed(ebiten.Key1) {
Expand Down

0 comments on commit a6fd95f

Please sign in to comment.