Exemplo n.º 1
0
        public Engine()
            : base()
        {
            // load settings
            Resolution = new Point(Settings.Resolution.X,
                                Settings.Resolution.Y);

            Fieldsize = new Point(Settings.FieldSize.X,
                                  Settings.FieldSize.Y);

            InitialBombs = Settings.Bombs;
            Scale = Settings.Scale;
            CorrectionScale = Settings.CorrectionScale;
            Port = Settings.Port;
            initialTime = Settings.Time;
            initialMaxHP = 100;
            currentTime = initialTime;

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferHeight = Settings.Resolution.Y;
            graphics.PreferredBackBufferWidth = Settings.Resolution.X;
            graphics.ApplyChanges();

            PlayerData = new Player.Data(initialMaxHP);

            this.playField = new Playfield.Field(this, Resolution, Fieldsize, InitialBombs);

            Point TimerPosition = new Point();
            TimerPosition.X = 5;
            TimerPosition.Y = (Resolution.Y - 83);
            this.Timer = new PlayerFeedback.CountdownTimer(this, initialTime, TimerPosition);
            Timer.IsEnabled = true;
            
            this.Info = new PlayerFeedback.InfoView(this, PlayerData, new Point(220, Resolution.Y - 60));
            
            this.GameOverScreen = new PlayerFeedback.GameOverView(this, PlayerData.Score);

            this.tutorial = new PlayerFeedback.Tutorial(this);

            Content.RootDirectory = "Content";
        }
Exemplo n.º 2
0
 public void Show(CountdownTimer timer)
 {
     this.IsShown = true;
     targetTimer = timer;
 }