fixed lit thresholds
This commit is contained in:
@ -25,6 +25,22 @@ func (l *Level) GetTile (coords types.Coords) *Tile {
|
||||
return l.Tiles[coords.Y*l.W+coords.X]
|
||||
}
|
||||
|
||||
func (l *Level) GetTileNbs (coords types.Coords) []*Tile {
|
||||
result := make([]*Tile,0)
|
||||
for i := coords.X-1; i < coords.X+1; i++ {
|
||||
for j := coords.Y-1; j < coords.Y+1; j++ {
|
||||
nbc := types.Coords{i,j}
|
||||
if l.InBounds(nbc){
|
||||
if nbc == coords {
|
||||
continue
|
||||
}
|
||||
result = append(result, l.GetTileByXY(i,j))
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (l *Level) GetTileByXY (x,y int) *Tile {
|
||||
return l.Tiles[y*l.W+x]
|
||||
}
|
||||
|
Reference in New Issue
Block a user