예제 #1
0
파일: Teno.cs 프로젝트: PhamCaoLuong/OOP
 public void Respawn()
 {
     state            = new RightIdleTS(this);
     physState        = new VVVVVVGroundState(this, 1);
     gravityDirection = 1;
     position         = Game1.GetInstance().level.checkpoint;
 }
예제 #2
0
        public void Update(GameTime gameTime)
        {
            game.gameHUD.Update(gameTime);
            if (walkTimer > 0)
            {
                if (slowFrames >= ValueHolder.slowdownRate)
                {
                    right.Execute();
                    game.level.Update(gameTime);
                    slowFrames = 0;
                }
                slowFrames *= 2;
            }
            else
            {
                game.level.mario.MakeVictoryTeno();
                if (walkTimer < -70)
                {
                    Game1.GetInstance().level = new Level(StringHolder.levelOne);
                    Game1.GetInstance().background.CurrentSprite = Game1.GetInstance().background.OverworldSprite;
                    Game1.GetInstance().gameState = new TitleScreenGameState();
                    Game1.GetInstance().isTitle = true;
                    Game1.GetInstance().gameHUD.Coins = 0;
                    Game1.GetInstance().gameHUD.Lives = 3;
                    Game1.GetInstance().gameHUD.Score = 0;
                }
            }
            walkTimer--;

            if (game.gameHUD.Time > 0)
            {
                game.gameHUD.Time--;
                game.gameHUD.Score += ValueHolder.remainingTimePoints;
            }
        }
예제 #3
0
 public PauseGameState()
 {
     game                    = Game1.GetInstance();
     game.isPaused           = true;
     game.keyboardController = new PauseMenuKeyController();
     //SoundManager.pause.Play();
     game.gameHUD.PausedCheck = true;
 }
예제 #4
0
 public DeadGameState(Teno mario)
 {
     game      = Game1.GetInstance();
     this.teno = mario;
     //SoundManager.StopMusic();
     //SoundManager.death.Play();
     teno.isDead = true;
 }
예제 #5
0
        public DeadTeno(Teno teno)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.deadTeno);
            this.teno = teno;
            Game1.GetInstance().gameState = new DeadGameState(teno);
        }
예제 #6
0
 public TenoGameState()
 {
     game = Game1.GetInstance();
     game.keyboardController  = new KeyboardController(game.level.mario);
     game.gameHUD.PausedCheck = false;
     game.gameHUD.gameEnded   = false;
     game.isVVVVVV            = false;
     game.isVictory           = false;
 }
예제 #7
0
 public LivesScreenGameState()
 {
     game = Game1.GetInstance();
     game.gameHUD.Lives--;
     font = game.Content.Load <SpriteFont>(StringHolder.bigTextFont);
     game.keyboardController = new PauseMenuKeyController();
     game.gameHUD.Time       = ValueHolder.startingTime;
     game.gameHUD.textColor  = ValueHolder.blackScreenText;
 }
예제 #8
0
 public VictoryGameState()
 {
     game           = Game1.GetInstance();
     game.isVictory = true;
     //SoundManager.StopMusic();
     //SoundManager.clear.Play();
     right = new RightCommand(game.level.teno);
     game.gameHUD.gameEnded = true;
     game.ach.AchievementAdjustment(AchievementsManager.AchievementType.Level);
 }
예제 #9
0
 public VVVVVVGameState()
 {
     game = Game1.GetInstance();
     game.level.mario.physState    = new VVVVVVGroundState(game.level.teno, 1);
     game.keyboardController       = new VVVVVVKeyController(game.level.teno);
     game.background.CurrentSprite = new NullSprite();
     game.gameHUD.PausedCheck      = false;
     game.gameHUD.gameEnded        = false;
     game.isVVVVVV = true;
     game.isTitle  = false;
 }
예제 #10
0
 public void Update(GameTime gameTime)
 {
     songTimer--;
     if (songTimer < 0)
     {
         Game1.GetInstance().level = new Level(StringHolder.levelOne);
         Game1.GetInstance().background.CurrentSprite = Game1.GetInstance().background.OverworldSprite;
         Game1.GetInstance().gameState = new TitleScreenGameState();
         Game1.GetInstance().isTitle = true;
         Game1.GetInstance().gameHUD.Coins = 0;
         Game1.GetInstance().gameHUD.Lives = 3;
         Game1.GetInstance().gameHUD.Score = 0;
     }
 }
예제 #11
0
 public TitleScreenGameState()
 {
     factory = new SpriteFactory();
     logo    = factory.build(SpriteFactory.sprites.title);
     //SoundManager.PlaySong(SoundManager.songs.title);
     game = Game1.GetInstance();
     menu = new GUI(game);
     menu.options.Add(new KeyValuePair <ICommands, String>(new LoadLevelCommand(StringHolder.levelOne), "Level 1"));
     menu.options.Add(new KeyValuePair <ICommands, String>(new LoadLevelCommand(StringHolder.levelTwo), "Level 2"));
     menu.options.Add(new KeyValuePair <ICommands, String>(new LoadLevelCommand(StringHolder.levelThree), "Level 3"));
     menu.options.Add(new KeyValuePair <ICommands, String>(new LoadAchPageCommand(), "Achievements"));
     menu.options.Add(new KeyValuePair <ICommands, String>(new QuitCommand(), "Quit"));
     menu.currentCommand     = menu.options[0].Key;
     game.keyboardController = new TitleKeyController(menu);
 }
예제 #12
0
 public GameOverState()
 {
     game            = Game1.GetInstance();
     game.isGameOver = true;
     font            = game.Content.Load <SpriteFont>(StringHolder.bigTextFont);
 }