Exemplo n.º 1
0
        public Game1(OptionsDialog options)
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferHeight = 720;
            graphics.PreferredBackBufferWidth = 1280;
            Content.RootDirectory = "Content";

            float hp, strength, range, speed, x, y;

            hp = float.Parse(options.hpUnit1_Text.Text);
            strength = float.Parse(options.strUnit1_Text.Text);
            range = float.Parse(options.rangeUnit1_Text.Text);
            speed = float.Parse(options.speedUnit1_Text.Text);
            x = int.Parse(options.x_Unit1_Text.Text);
            y = int.Parse(options.y_Unit1_Text.Text);
            var color = (System.Drawing.Color)options.Unit1_Team.SelectedItem;
            map.Add(new Unit(x, y, new Team(new Color(color.R, color.G, color.B)), strength, hp, range, speed));

            hp = float.Parse(options.hpUnit2_Text.Text);
            strength = float.Parse(options.strUnit2_Text.Text);
            range = float.Parse(options.rangeUnit2_Text.Text);
            speed = float.Parse(options.speedUnit2_Text.Text);
            x = int.Parse(options.x_Unit2_Text.Text);
            y = int.Parse(options.y_Unit2_Text.Text);
            color = (System.Drawing.Color)options.Unit2_Team.SelectedItem;
            map.Add(new Unit(x, y, new Team(new Color(color.R, color.G, color.B)), strength, hp, range, speed));

            color = System.Drawing.Color.Red;
            // map.Add(new Unit(200, 200, new Team(new Color(color.R, color.G, color.B)), strength, hp, range, speed));
            map.GenerateTargets();

            this.IsMouseVisible = true;
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var form = new OptionsDialog();
            var result = form.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            using (Game1 game = new Game1(form))
            {
                game.Run();
            }
        }