All directions
This commit is contained in:
@@ -13,5 +13,4 @@ const (
|
||||
NorthWest
|
||||
)
|
||||
|
||||
// var AllDirections = []Direction{North, East, South, West, NorthEast, SouthEast, SouthWest, NorthWest}
|
||||
var AllDirections = []Direction{South, North, NorthEast}
|
||||
var AllDirections = []Direction{North, East, South, West, NorthEast, SouthEast, SouthWest, NorthWest}
|
||||
|
||||
55
hero/hero.go
55
hero/hero.go
@@ -53,6 +53,28 @@ func (h *Hero) DrawHero(screen *ebiten.Image) {
|
||||
{201, 0},
|
||||
}
|
||||
|
||||
movementPositions[configuration.East] = []spritePosition{
|
||||
{132, 99},
|
||||
{165, 99},
|
||||
{198, 99},
|
||||
{0, 132},
|
||||
{33, 132},
|
||||
{0, 132},
|
||||
{198, 99},
|
||||
{165, 99},
|
||||
}
|
||||
|
||||
movementPositions[configuration.SouthEast] = []spritePosition{
|
||||
{33, 66},
|
||||
{66, 66},
|
||||
{99, 66},
|
||||
{132, 66},
|
||||
{165, 66},
|
||||
{132, 66},
|
||||
{99, 66},
|
||||
{66, 66},
|
||||
}
|
||||
|
||||
movementPositions[configuration.South] = []spritePosition{
|
||||
{66, 132},
|
||||
{0, 99},
|
||||
@@ -63,6 +85,39 @@ func (h *Hero) DrawHero(screen *ebiten.Image) {
|
||||
{33, 99},
|
||||
{0, 99},
|
||||
}
|
||||
|
||||
movementPositions[configuration.SouthWest] = []spritePosition{
|
||||
{99, 33},
|
||||
{33, 0},
|
||||
{66, 0},
|
||||
{99, 0},
|
||||
{132, 0},
|
||||
{99, 0},
|
||||
{66, 0},
|
||||
{33, 0},
|
||||
}
|
||||
|
||||
movementPositions[configuration.West] = []spritePosition{
|
||||
{198, 66},
|
||||
{99, 132},
|
||||
{132, 132},
|
||||
{165, 132},
|
||||
{198, 132},
|
||||
{165, 132},
|
||||
{132, 132},
|
||||
{99, 132},
|
||||
}
|
||||
|
||||
movementPositions[configuration.NorthWest] = []spritePosition{
|
||||
{0, 0},
|
||||
{132, 33},
|
||||
{165, 33},
|
||||
{198, 33},
|
||||
{0, 66},
|
||||
{198, 33},
|
||||
{165, 33},
|
||||
{132, 33},
|
||||
}
|
||||
p := movementPositions[h.direction][h.step%8]
|
||||
|
||||
op := &ebiten.DrawImageOptions{}
|
||||
|
||||
Reference in New Issue
Block a user