From fbb441de0747f69d30eab5a88ec3c722ef492930 Mon Sep 17 00:00:00 2001 From: gmzar Date: Wed, 10 Jul 2019 19:44:16 -0700 Subject: [PATCH] part 3, 2/7 --- mapping/gamemap.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/mapping/gamemap.go b/mapping/gamemap.go index 297ea8a..4db887f 100644 --- a/mapping/gamemap.go +++ b/mapping/gamemap.go @@ -11,20 +11,15 @@ func (g *GameMap) Initialize() { for x := range g.Tiles { g.Tiles[x] = make([]Tile, g. Height) + for y := range g.Tiles[x] { + g.Tiles[x][y] = Tile{ + BlockSight: true, + BlockMovement: true, + } + } } - g.Tiles[30][22] = Tile { - BlockMovement: true, - BlockSight: true, - } - g.Tiles[31][22] = Tile{ - BlockMovement: true, - BlockSight: true, - } - g.Tiles[32][22] = Tile{ - BlockMovement: true, - BlockSight: true, - } + } // IsBlocked returns if the given coordinates are blocking movement.