refactor level, getting to tiles
This commit is contained in:
@ -192,7 +192,7 @@ func (ps *precomputedShade) recalc(level *gamemap.Level, initCoords types.Coords
|
||||
radius = ps.MaxTorchRadius //fixme
|
||||
}
|
||||
|
||||
level.Tiles[initCoords.X][initCoords.Y].Visible = true
|
||||
level.GetTile(initCoords).Visible = true
|
||||
|
||||
var fullShade = make([]byte, 360)
|
||||
for i := range fullShade {
|
||||
@ -226,7 +226,7 @@ func (ps *precomputedShade) recalc(level *gamemap.Level, initCoords types.Coords
|
||||
//fmt.Printf("\n level coords: %v", lc)
|
||||
for _, angle := range cell.occludedAngles {
|
||||
|
||||
if level.Tiles[lc.X][lc.Y].BlocksSight {
|
||||
if level.GetTile(lc).BlocksSight {
|
||||
nextShade[angle] = 1
|
||||
}
|
||||
|
||||
@ -236,8 +236,8 @@ func (ps *precomputedShade) recalc(level *gamemap.Level, initCoords types.Coords
|
||||
|
||||
}
|
||||
|
||||
if level.Tiles[lc.X][lc.Y].BlocksSight {
|
||||
level.Tiles[lc.X][lc.Y].Visible = true
|
||||
if level.GetTile(lc).BlocksSight {
|
||||
level.GetTile(lc).Visible = true
|
||||
}
|
||||
|
||||
}
|
||||
@ -254,7 +254,7 @@ func (ps *precomputedShade) ComputeFov(level *gamemap.Level, initCoords types.Co
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
level.Tiles[cs.X][cs.Y].Visible = true
|
||||
level.GetTile(cs).Visible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user