Exemplo n.º 1
0
 public Pause(ref global_vars vars, ref Playable playmode, ref Game1 game)
     : base(game)
 {
     this.game = game;
     this.playmode = playmode;
     thisPause = this;
     variables = vars;
     HUDLocation = variables.HUDLOC;
     layoverPosition = new Rectangle(0, 0, variables.screen_width, variables.screen_height);
     pauseTimer = new Timer(vars.PAUSE_DELAY, game);
     pauseTimer.Elapsed = pauseDelay;
 }
Exemplo n.º 2
0
        public override void Initialize()
        {
            //Stop theme music
            game.stopTheme();

            mapBatch = new SpriteBatch(variables.manager.GraphicsDevice);
            //Add character to map
            game.Components.Add(character);
            //Add pause screen component
            pauseScreen = new Pause(ref variables, ref play, ref game);
            game.Components.Add(pauseScreen);

            //Start releasing Shadow eaters after 2 minutes
            shadowEaterStart = new Timer(variables.SHADOW_START, game);
            shadowEaterStart.Elapsed = startShadow
            shadowEaterStart.Start();

            //Set Up special timer
            specTimer = new Timer(60000, game);
            specTimer.Elapsed = ActivateSpecial;
            //Set Up autosave
            autosave = new AutoSave(new callback(TimeToSave), 15000);

            //Set up spawn delay thread
            spawnDelay = new Timer(250, game);
            spawnDelay.Elapsed = setRelease;

            base.Initialize();
        }
Exemplo n.º 3
0
 public static void handlePauseScreenCommands(ref Pause pause, ref global_vars vars)
 {
     keypressed = Keyboard.GetState();
     if (keypressed.IsKeyDown(vars.PAUSE))
         pause.PauseGame();
     else if (keypressed.IsKeyDown(vars.QUIT))
         pause.Quit();
 }