diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2023-10-02 22:03:25 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2023-10-02 22:03:25 +0200 |
| commit | 7e80b9cc8535973be68a1444843ecfc81d3ff355 (patch) | |
| tree | 043c1901e25b00268f7aded60f6c2b9d4a70a6f7 /main.go | |
| parent | 129d4d173b7c55e7a24ed49c2f50b50c56192253 (diff) | |
fix(move): Keep current path during move if it still applies
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -13,8 +13,8 @@ import ( type Action string const ( - Selecting Action = "selecting" - Patroling Action = "patroling" + Selecting Action = "selecting" + Patrolling Action = "patrolling" ) var soilColor = color.RGBA{0x60, 0x40, 0x20, 0xff} @@ -69,7 +69,7 @@ func (g *Game) updateSelecting(cursor Point, moveMap MoveMap) { } } -func (g *Game) updatePatroling(cursor Point) { +func (g *Game) updatePatrolling(cursor Point) { if inpututil.IsMouseButtonJustReleased(ebiten.MouseButtonRight) { destination := cursor.Div(100).Mul(100) for _, e := range g.Entities { @@ -87,15 +87,15 @@ func (g *Game) Update() error { slog.Info("selecting action") } if inpututil.IsKeyJustReleased(ebiten.KeyA) { // Should be Q - g.CurrentAction = Patroling - slog.Info("patroling action") + g.CurrentAction = Patrolling + slog.Info("patrolling action") } moveMap := g.getMoveMap() switch g.CurrentAction { case Selecting: g.updateSelecting(cursor, moveMap) - case Patroling: - g.updatePatroling(cursor) + case Patrolling: + g.updatePatrolling(cursor) } for _, e := range g.Entities { e.UpdateMove(moveMap) |
