refactor level, getting to tiles

This commit is contained in:
anton.gurov
2019-10-31 14:01:54 +03:00
parent e0bab00a23
commit c372670953
11 changed files with 189 additions and 180 deletions

View File

@ -18,7 +18,7 @@ func DefaultGen(l *gamemap.Level) *gamemap.Level {
//fill with walls
for i := 0; i < l.W; i ++ {
for j := 0; j < l.H; j++ {
l.Tiles[i][j] = gamemap.NewWall()
l.SetTileByXY(i, j, gamemap.NewWall())
}
}
@ -113,7 +113,7 @@ func digHTunnel(l *gamemap.Level, x1,x2,y int, fillage types.RectFill) {
}
for i := start; i <= finish; i++ {
if l.InBounds(types.Coords{i, y}) {
l.Tiles[i][y] = fillage.Body.(func() *gamemap.Tile)()
l.SetTileByXY(i, y, fillage.Body.(func() *gamemap.Tile)())
//l.Tiles[i][y] = gamemap.NewFloor()
}
}
@ -130,7 +130,7 @@ func digVTunnel(l *gamemap.Level, y1,y2,x int, fillage types.RectFill) {
}
for i := start; i <= finish; i++ {
if l.InBounds(types.Coords{x, i}) {
l.Tiles[x][i] = fillage.Body.(func() *gamemap.Tile)()
l.SetTileByXY(x, i, fillage.Body.(func() *gamemap.Tile)())
}
}
}