Пример #1
0
        public override void onCollide(Entity entity, Game1 game)
        {
            if (entity is Player)
            {
                Boolean allEnemiesKilled = true;
                foreach (Entity e in game.entities)
                {
                    if (e is Enemy)
                    {
                        allEnemiesKilled = false;
                    }
                }

                if (allEnemiesKilled)
                {
                    game.loadLevel(nextLevel);
                }
                else
                {
                    game.showText("The door is still closed!");
                }
            }

            base.onCollide(entity, game);
        }
Пример #2
0
        public override void onCollide(Entity entity, Game1 game)
        {
            if (entity is Player)
            {
                Boolean allEnemiesKilled = true;
                foreach (Entity e in game.entities)
                {
                    if (e is Enemy)
                    {
                        allEnemiesKilled = false;
                    }
                }

                if (allEnemiesKilled)
                {
                    game.loadLevel(nextLevel);
                }
                else
                {
                    game.showText("The door is still closed!");
                }
            }

            base.onCollide(entity, game);
        }
Пример #3
0
 public override void update(Game1 game, GameTime gameTime)
 {
     if (timer > 200)
     {
         game.loadLevel(1);
     }
     if (startedTimer)
     {
         timer++;
     }
 }
Пример #4
0
 public override void update(Game1 game, GameTime gameTime)
 {
     if (timer > 200)
     {
         game.loadLevel(1);
     }
     if (startedTimer)
     {
         timer++;
     }
 }
Пример #5
0
        public override void update(Game1 game, GameTime gameTime)
        {
            KeyboardState keyboard = Keyboard.GetState();

            if (keyboard.IsKeyDown(Keys.R))
            {
                game.loadLevel(0);
            }

            base.update(game, gameTime);
        }
Пример #6
0
        public override void update(Game1 game, GameTime gameTime)
        {
            KeyboardState keyboard = Keyboard.GetState();

            if (keyboard.IsKeyDown(Keys.R))
            {
                game.loadLevel(0);
            }

            base.update(game, gameTime);
        }
Пример #7
0
        public override void update(Game1 game, GameTime gameTime)
        {
            KeyboardState keyboard = Keyboard.GetState();

            if (keyboard.IsKeyDown(Keys.R))
            {
                game.loadLevel(0);
            }

            //            game.showText("You died while trying to escape the asylum. Press \"r\" to restart.");

            base.update(game, gameTime);
        }
Пример #8
0
        public override void update(Game1 game, GameTime gameTime)
        {
            KeyboardState keyboard = Keyboard.GetState();

            if (keyboard.IsKeyDown(Keys.R))
            {
                game.loadLevel(0);
            }

//            game.showText("You died while trying to escape the asylum. Press \"r\" to restart.");

            base.update(game, gameTime);
        }
Пример #9
0
        public override void update(Game1 game, GameTime gameTime)
        {
            flashTimer++;
            endTimer++;

            if (endTimer > 250)
            {
                game.loadLevel(4);
            }
            else if (endTimer > 200)
            {
                show = true;
            }
            else if (flashTimer > flashMaxTimer)
            {
                flashTimer = 0;
                show = !show;
            }
        }
Пример #10
0
        public override void update(Game1 game, GameTime gameTime)
        {
            flashTimer++;
            endTimer++;

            if (endTimer > 250)
            {
                game.loadLevel(4);
            }
            else if (endTimer > 200)
            {
                show = true;
            }
            else if (flashTimer > flashMaxTimer)
            {
                flashTimer = 0;
                show       = !show;
            }
        }