Exemplo n.º 1
0
        // Main Menu Items //

        private void MainMenuNew_Click(object sender, EventArgs e)
        {
            GlobalTimer.Enabled = false;

            Settings settings = new Settings();

            settings.ShowDialog();

            if (settings.IsHandled)
            {
                if (Camera == null)
                {
                    Camera = new Camera(Scene.Location, Scene.Bounds.Size, settings.CameraScale);
                }
                else
                {
                    Camera.ChangeScale(settings.CameraScale);
                    Camera.Reshape(Scene.Bounds.Size);
                    Camera.Relocate(Scene.Location);
                }

                Game.StartNew(settings.Seed, Scene.Height / Camera.Scale + 1, Scene.Width / Camera.Scale + 1, settings.PopulationRate);
                GlobalTimer.Interval = 50;
                Scene.Invalidate();
            }
        }