precomputed shade algo, viewport basic render

This commit is contained in:
anton.gurov
2019-10-30 17:56:30 +03:00
parent 4a77323aab
commit 3958951cd5
15 changed files with 924 additions and 26 deletions

View File

@ -26,7 +26,9 @@ func (l *Level) Put (x, y int, tileFunc interface{}) {
if tf == nil {
l.ctx.Logger().Fatal().Msgf("Got non-tile type to put into level: %v", tf)
}
l.Tiles[x][y] = tf
if l.InBounds(types.Coords{x, y}) {
l.Tiles[x][y] = tf
}
}
func NewLevel(ctx util.ClientCtx, branch string, depth int) *Level {
@ -46,5 +48,5 @@ func NewLevel(ctx util.ClientCtx, branch string, depth int) *Level {
type Room struct {
*types.Rect
Center *types.Coords
Center types.Coords
}