private void MainFrame_Load(object sender, System.EventArgs e) { _timer = new Timer(); _timer.Interval = Constants.defaultTimerPeriod; _timer.Tick += new System.EventHandler(MainFrame_Tick); _zoom = Constants.ZoomDefault; WorldGeneration generator = new WorldGeneration(907); _currentMap = generator.GenerateVillage(Constants.MapSize, Constants.MapSize); _painter = new Painter(this, _currentMap, _zoom); _currentMap.AnalyzeTileAccessibility(); Team team1 = new Team(Color.Red); Team team2 = new Team(Color.Blue); for (int j = 0; j < 2; ++j) { for (int i = 0; i < 5; ++i) { _currentMap.SpawnCreature(new Coords(CoordsType.Tile, i, j), team1, Constants.CreatureGeneratorGnome); } } for (int j = 0; j < 2; ++j) { for (int i = 0; i < 5; ++i) { _currentMap.SpawnCreature(new Coords(CoordsType.Tile, i, _currentMap.BoundY - 1 - j), team2, Constants.CreatureGeneratorGnome); } } _currentMap.SpawnPlayer(Constants.PlayerStartPos); //_player = _currentMap.PlayerReference; //_screenAnchor = this.TransformCenterAtPlayer(); _scheduler = new Scheduler(_currentMap); _ledger = new Ledger(_scheduler); _timer.Start(); }
private void MainFrame_Load(object sender, System.EventArgs e) { _timer = new Timer(); _timer.Interval = Constants.defaultTimerPeriod; _timer.Tick += new System.EventHandler(MainFrame_Tick); _zoom = Constants.ZoomDefault; WorldGeneration generator = new WorldGeneration(907); _currentMap = generator.GenerateVillage(Constants.MapSize, Constants.MapSize); _painter = new Painter(this, _currentMap, _zoom); _currentMap.AnalyzeTileAccessibility(); Team team1 = new Team(Color.Red); Team team2 = new Team(Color.Blue); for (int j = 0; j < 2; ++j) { for (int i = 0; i < 5; ++i) { _currentMap.SpawnCreature(new Coords(CoordsType.Tile, i, j), team1, Constants.CreatureGeneratorGnome); } } for (int j = 0; j < 2; ++j) { for (int i = 0; i < 5; ++i) { _currentMap.SpawnCreature(new Coords(CoordsType.Tile, i, _currentMap.BoundY-1-j), team2, Constants.CreatureGeneratorGnome); } } _currentMap.SpawnPlayer(Constants.PlayerStartPos); //_player = _currentMap.PlayerReference; //_screenAnchor = this.TransformCenterAtPlayer(); _scheduler = new Scheduler(_currentMap); _ledger = new Ledger(_scheduler); _timer.Start(); }