diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2023-08-30 14:08:22 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2023-08-30 14:08:22 +0200 |
| commit | fe270d1509fa62832e8ade9cb48e6ca86b07d57f (patch) | |
| tree | 73a06ecdfd15191dbc8e424e41706309a516ab8b | |
| parent | 8add12c817e5af9d41bcf96c8387f8c2322b6f04 (diff) | |
feat: Display line where person is moving to
| -rw-r--r-- | main.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -5,6 +5,7 @@ import ( "github.com/hajimehoshi/ebiten/v2" "github.com/hajimehoshi/ebiten/v2/inpututil" + "github.com/hajimehoshi/ebiten/v2/vector" ) type Tile struct { @@ -64,6 +65,9 @@ func (g *Game) Draw(screen *ebiten.Image) { op := &ebiten.DrawImageOptions{} op.GeoM.Translate(float64(p.Position.X-bounds.Dx()/2), float64(p.Position.Y-bounds.Dy()/2)) soil.DrawImage(p.Image(), op) + if p.IsSelected && p.move.IsActive { + vector.StrokeLine(soil.Image, float32(p.Position.X), float32(p.Position.Y), float32(p.move.Destination.X), float32(p.move.Destination.Y), 10.0, color.RGBA{256 * 3 / 16, 256 * 3 / 16, 256 * 3 / 16, 256 / 4}, true) + } } op := &ebiten.DrawImageOptions{} op.GeoM.Translate(float64(soil.Position.X), float64(soil.Position.Y)) |
