diff --git a/game.go b/game.go index 1a2d692..427f53c 100644 --- a/game.go +++ b/game.go @@ -51,6 +51,7 @@ type game struct { projectiles map[*Projectile]bool splosions map[*Splosion]bool obstacles []Obstacle + obstacle_count int register chan *player unregister chan *player turn int @@ -74,6 +75,7 @@ func NewGame(id string, width, height float32, obstacles, tick int) *game { projectiles: make(map[*Projectile]bool), splosions: make(map[*Splosion]bool), obstacles: GenerateObstacles(obstacles, width, height), + obstacle_count: obstacles, players: make(map[*player]bool), turn: 0, width: width, @@ -307,7 +309,7 @@ func (g *game) gameOver() (bool, *GameOver) { var stats *GameOver if g.players_remaining <= 1 && len(g.players) > 1 { - g.obstacles = GenerateObstacles(conf.Obstacles, g.width, g.height) + g.obstacles = GenerateObstacles(g.obstacle_count, g.width, g.height) log.Printf("game %s: game over", g.id) stats = NewGameOver()