diff --git a/src/app.cr b/src/app.cr index e195ce5..d4c562f 100644 --- a/src/app.cr +++ b/src/app.cr @@ -6,7 +6,7 @@ class App @ts : Game::TimePoint def initialize - @map = Game::Generator.make 5, 5 + @map = Game::Generator.make 6, 8, 10 @ts = Time.local.to_unix @world = Game::World.new @map, @ts @buildings = Game::BuildingFactory.new diff --git a/src/game/map.cr b/src/game/map.cr index 85f1b3d..8a70c4a 100644 --- a/src/game/map.cr +++ b/src/game/map.cr @@ -62,10 +62,10 @@ module Game end class Generator - def self.make(rows, cols) : Map + def self.make(rows, cols, deposits = 5) : Map rnd = Random.new map = Map.new(rows, cols) - 5.times do + deposits.times do point = Point.new(rnd.rand(0...rows), rnd.rand(0...cols)) cap = rnd.rand(2...6) deposit = Deposit.new(Resource::Type::Crystals, cap * 50)