Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public InfanteryRenderer(Infantery data)
     : base(data)
 {
 }