public UnitHandler(Game game, CombatScreen screen) { this.game = game; this.screen = screen; units = new Unit[6]; rand = new Random(); pathfinder = new Pathfinder(screen.DataMaster.map); //Fill units with infantery. //TODO:: make this better. for (int i = 0; i < units.Length; i++) { units[i] = new Infantery(); units[i].Position = new SFML.Window.Vector2f( (float)Math.Round((double)rand.Next(0, 800/32)) * 32, (float)Math.Round((double)rand.Next(0, 640 / 32)) * 32); } units[units.Length - 1] = new Tank(); units[units.Length - 1].Position = new SFML.Window.Vector2f( (float)Math.Round((double)rand.Next(0, 800 / 32)) * 32, (float)Math.Round((double)rand.Next(0, 640 / 32)) * 32); screen.DataMaster.Units = units; }
static void Main(string[] args) { //init stage and input metadata stage = new RenderWindow(new VideoMode(800, 640), "WarGames"); stage.SetFramerateLimit(60); //init game and start it game = new Game(stage); game.start(); }
public CombatScreen(Game game) { this.game = game; dataMaster = new DataMaster(game); DataMaster = dataMaster; unitHandler = new UnitHandler(game, this); interfaceHandler = new InterfaceHandler(this); masterRenderer = new MasterRenderer(dataMaster); }
public UnitHandler(Game game, CombatScreen screen) { this.game = game; this.screen = screen; units = new List<Unit>(); rand = new Random(); pathfinder = new Pathfinder(screen.DataMaster.map); //Fill units list with infantery. for (int i = 0; i < 6; i++) { units.Add(new Infantery()); units[i].Position = new SFML.Window.Vector2f( (float)Math.Round((double)rand.Next(0, 800/32)) * 32, (float)Math.Round((double)rand.Next(0, 640 / 32)) * 32); } screen.DataMaster.Units = units; }