cleanups
This commit is contained in:
parent
2cd0a3cc5a
commit
e3e55da2a1
3 changed files with 25 additions and 28 deletions
|
@ -137,8 +137,9 @@ type Tile interface {
|
|||
|
||||
// Ensure StaticTile and AnimatedTile satisfy Tile.
|
||||
var (
|
||||
_ Tile = StaticTile(0)
|
||||
_ Tile = &AnimatedTile{}
|
||||
_ Tile = StaticTile(0)
|
||||
_ Tile = AnimatedTile{}
|
||||
_ Scanner = AnimatedTile{}
|
||||
)
|
||||
|
||||
// StaticTile returns a fixed tile index.
|
||||
|
|
28
game/aw.go
28
game/aw.go
|
@ -181,22 +181,18 @@ func (aw *Awakeman) Prepare(game *engine.Game) {
|
|||
{Frame: 12, Duration: 3},
|
||||
{Frame: 13, Duration: 3},
|
||||
}}
|
||||
aw.animWalkRight = &engine.Anim{
|
||||
Frames: []engine.AnimFrame{
|
||||
{Frame: 2, Duration: 6},
|
||||
{Frame: 3, Duration: 6},
|
||||
{Frame: 4, Duration: 6},
|
||||
{Frame: 5, Duration: 6},
|
||||
},
|
||||
}
|
||||
aw.animWalkLeft = &engine.Anim{
|
||||
Frames: []engine.AnimFrame{
|
||||
{Frame: 6, Duration: 6},
|
||||
{Frame: 7, Duration: 6},
|
||||
{Frame: 8, Duration: 6},
|
||||
{Frame: 9, Duration: 6},
|
||||
},
|
||||
}
|
||||
aw.animWalkRight = &engine.Anim{Frames: []engine.AnimFrame{
|
||||
{Frame: 2, Duration: 6},
|
||||
{Frame: 3, Duration: 6},
|
||||
{Frame: 4, Duration: 6},
|
||||
{Frame: 5, Duration: 6},
|
||||
}}
|
||||
aw.animWalkLeft = &engine.Anim{Frames: []engine.AnimFrame{
|
||||
{Frame: 6, Duration: 6},
|
||||
{Frame: 7, Duration: 6},
|
||||
{Frame: 8, Duration: 6},
|
||||
{Frame: 9, Duration: 6},
|
||||
}}
|
||||
}
|
||||
|
||||
func (aw *Awakeman) Scan() []interface{} { return []interface{}{&aw.Sprite} }
|
||||
|
|
20
main.go
20
main.go
|
@ -33,19 +33,19 @@ func main() {
|
|||
}}
|
||||
denseTiles := [][]engine.Tile{
|
||||
{engine.StaticTile(9), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, engine.StaticTile(9)},
|
||||
{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, &engine.AnimatedTile{Animer: redTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, &engine.AnimatedTile{Animer: redTileAnim.Copy()}, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, engine.AnimatedTile{Animer: redTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, engine.AnimatedTile{Animer: redTileAnim.Copy()}, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, &engine.AnimatedTile{Animer: greenTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, &engine.AnimatedTile{Animer: redTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, &engine.AnimatedTile{Animer: greenTileAnim.Copy()}, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, &engine.AnimatedTile{Animer: greenTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, &engine.AnimatedTile{Animer: greenTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, &engine.AnimatedTile{Animer: redTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, engine.StaticTile(9), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, engine.AnimatedTile{Animer: greenTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, engine.AnimatedTile{Animer: redTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, engine.AnimatedTile{Animer: greenTileAnim.Copy()}, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, engine.AnimatedTile{Animer: greenTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, engine.AnimatedTile{Animer: greenTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, engine.AnimatedTile{Animer: redTileAnim.Copy()}, nil, nil, nil, nil, nil, nil, engine.StaticTile(9), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{nil, nil, nil, nil, nil, engine.StaticTile(9), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, engine.StaticTile(9), nil, nil, nil},
|
||||
{nil, nil, nil, nil, engine.StaticTile(9), engine.StaticTile(9), engine.StaticTile(9), nil, nil, nil, engine.StaticTile(9), nil, nil, nil, nil, nil, nil, nil, nil, nil},
|
||||
{engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), &engine.AnimatedTile{Animer: redTileAnim.Copy()}, engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8)},
|
||||
{engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), &engine.AnimatedTile{Animer: redTileAnim.Copy()}, engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), &engine.AnimatedTile{Animer: greenTileAnim.Copy()}, engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7)},
|
||||
{engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.AnimatedTile{Animer: redTileAnim.Copy()}, engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8), engine.StaticTile(8)},
|
||||
{engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.AnimatedTile{Animer: redTileAnim.Copy()}, engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.AnimatedTile{Animer: greenTileAnim.Copy()}, engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7)},
|
||||
{engine.StaticTile(9), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(7), engine.StaticTile(9)},
|
||||
}
|
||||
tiles := make(map[image.Point]engine.Tile)
|
||||
|
|
Loading…
Reference in a new issue