コード例 #1
0
ファイル: FlagPoleClass.cs プロジェクト: siegeownager/cse3902
 public FlagPole(Game1 game, Vector2 location)
 {
     this.MyGame   = game;
     this.Sprite   = SpriteFactory.CreateFlagPole();
     MyGame.Sprite = Sprite;
     this.Location = location;
 }
コード例 #2
0
ファイル: FireworkClass.cs プロジェクト: siegeownager/cse3902
 public FireworkClass(Game1 game, Vector2 location)
 {
     this.MyGame   = game;
     this.Sprite   = SpriteFactory.CreateFirework();
     MyGame.Sprite = Sprite;
     this.Location = location;
 }
コード例 #3
0
 public Sun(Game1 game, Vector2 location)
 {
     MyGame   = game;
     Sprite   = SpriteFactory.CreateSun();
     Location = location;
     count    = 0;
 }
コード例 #4
0
ファイル: Flower.cs プロジェクト: siegeownager/cse3902
 public Flower(Game1 game, Vector2 location)
 {
     MyGame        = game;
     Sprite        = SpriteFactory.CreateFlower();
     MyGame.Sprite = Sprite;
     HasBeenUsed   = false;
     this.Location = location;
 }
コード例 #5
0
ファイル: EnergyDrink.cs プロジェクト: siegeownager/cse3902
 public EnergyDrink(Game1 game, Vector2 location)
 {
     MyGame        = game;
     Sprite        = SpriteFactory.CreateEnergyDrink();
     MyGame.Sprite = Sprite;
     HasBeenUsed   = false;
     this.Location = location;
 }
コード例 #6
0
 public Missle(Game1 game, Vector2 location)
 {
     MovingLeft = true;
     IsFalling  = true;
     MyGame     = game;
     Sprite     = SpriteFactory.CreateMissle();
     CanAttack  = true;
     Location   = location;
 }
コード例 #7
0
 public Coin(Game1 game, Vector2 location)
 {
     MyGame          = game;
     Sprite          = SpriteFactory.CreateCoin();
     MyGame.Sprite   = this.Sprite;
     playSoundEffect = false;
     HasBeenUsed     = false;
     Location        = location;
 }
コード例 #8
0
 public Star(Game1 game, Vector2 location)
 {
     MyGame        = game;
     Sprite        = SpriteFactory.CreateStar();
     MyGame.Sprite = Sprite;
     HasBeenUsed   = false;
     MovingLeft    = false;
     IsFalling     = true;
     this.Location = location;
 }
コード例 #9
0
ファイル: Nami.cs プロジェクト: siegeownager/cse3902
 public Nami(Game1 game, Vector2 location)
 {
     MovingLeft = true;
     IsFalling  = true;
     MyGame     = game;
     Sprite     = SpriteFactory.CreateNami();
     CanAttack  = true;
     Location   = location;
     up         = true;
 }
コード例 #10
0
ファイル: GodMushroom.cs プロジェクト: siegeownager/cse3902
 public GodMushroom(Game1 game, Vector2 location)
 {
     MovingLeft    = false;
     MyGame        = game;
     Sprite        = SpriteFactory.CreateGodMushroom();
     IsFalling     = true;
     MyGame.Sprite = Sprite;
     HasBeenUsed   = false;
     this.Location = location;
 }
コード例 #11
0
ファイル: Goomba.cs プロジェクト: siegeownager/cse3902
 public Goomba(Game1 game, Vector2 location)
 {
     MovingLeft           = true;
     IsFalling            = true;
     MyGame               = game;
     Sprite               = SpriteFactory.CreateGoomba();
     CanAttack            = true;
     playDeathSoundEffect = false;
     Location             = location;
     dead = false;
 }
コード例 #12
0
ファイル: Koopa.cs プロジェクト: siegeownager/cse3902
 public Koopa(Game1 game, Vector2 location)
 {
     MovingLeft           = true;
     IsFalling            = true;
     MyGame               = game;
     Sprite               = SpriteFactory.CreateKoopaMoveLeft();
     MyGame.Sprite        = Sprite;
     CanAttack            = true;
     this.Location        = location;
     playDeathSoundEffect = false;
     dead = false;
 }
コード例 #13
0
ファイル: Koopa.cs プロジェクト: siegeownager/cse3902
 public void GetKilled(bool killedBySmashed)
 {
     if (!dead)
     {
         this.Sprite = SpriteFactory.CreateKoopaShellSprite();
         dead        = true;
         if (killedBySmashed)
         {
             MyGame.PlayerStat.SetScoreValue(600 * MarioAndEnemyCollisionHandling.ConsecutiveBonusPoint);
         }
         else
         {
             MyGame.PlayerStat.SetScoreValue(200);
         }
     }
 }
コード例 #14
0
ファイル: FlagPoleClass.cs プロジェクト: siegeownager/cse3902
        public async void BecomeUsed()
        {
            Game1.GetInstance.DisableControl = true;
            MyGame.PlayerStat.SetScoreValue(5000);
            MyGame.PlayerStat.SetEndGame(true);
            MarioWalkToCastleHandler obj = new MarioWalkToCastleHandler(MyGame, Location);

            this.Sprite = SpriteFactory.CreateFlagPoleToUsed();
            await Task.Delay(4000);

            new LevelGenerator();
            Game1.FileName = "Level1.xml";
            Game1.GetInstance.GameStatus = Game1.GameState.LivesScreen;
            command = new ResetCommand(Game1.GetInstance);
            command.Execute();
        }
コード例 #15
0
        protected override void LoadContent()
        {
            SpriteBatch = new SpriteBatch(GraphicsDevice);

            Texture                 = Content.Load <Texture2D>("MarioSheet");
            BackgroundMusic         = Content.Load <Song>("backgroundMusic");
            pauseSoundEffect        = Content.Load <SoundEffect>("pauseSoundEffect");
            blackHole               = Content.Load <Texture2D>("blackholeSprite");
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume      = 0.6f;
            SpriteFactory.LoadAllTextures(Content);
            Block = new BlockLogic(this);
            Mario.LoadContent(Content);
            World = new WorldManager(this);
            World.Load();
            PlayerStat = new PlayerStatistic(SpriteBatch, Content);

            KeyboardController = new KeyboardController();
            KeyboardController.RegisterCommand(Keys.Left, new MarioLookLeftCommand(this));
            KeyboardController.RegisterCommand(Keys.Right, new MarioLookRightCommand(this));
            KeyboardController.RegisterCommand(Keys.Down, new MarioLookDownCommand(this));
            KeyboardController.RegisterCommand(Keys.A, new MarioLookLeftCommand(this));
            KeyboardController.RegisterCommand(Keys.D, new MarioLookRightCommand(this));
            KeyboardController.RegisterCommand(Keys.S, new MarioLookDownCommand(this));
            KeyboardController.RegisterCommand(Keys.Z, new MarioJumpCommand(this));
            KeyboardController.RegisterCommand(Keys.Q, new QuitCommand(this));
            KeyboardController.RegisterCommand(Keys.R, new ResetCommand(this));
            KeyboardController.RegisterCommand(Keys.X, new MarioRunCommand(this));

            GamepadController = new GamepadController();
            GamepadController.RegisterCommand(Buttons.LeftThumbstickLeft, new MarioLookLeftCommand(this));
            GamepadController.RegisterCommand(Buttons.LeftThumbstickRight, new MarioLookRightCommand(this));
            GamepadController.RegisterCommand(Buttons.LeftThumbstickDown, new MarioLookDownCommand(this));
            GamepadController.RegisterCommand(Buttons.X, new ResetCommand(this));
            GamepadController.RegisterCommand(Buttons.A, new MarioJumpCommand(this));
            GamepadController.RegisterCommand(Buttons.B, new MarioRunCommand(this));

            MouseController = new MouseController();
            MouseController.RegisterCommand("LeftMouseClick", new MarioRunCommand(this));
            MouseController.RegisterCommand("RightMouseClick", new MarioJumpCommand(this));
        }
コード例 #16
0
 public PlayerStatistic(SpriteBatch spritePatch, ContentManager content)
 {
     spriteBatch       = spritePatch;
     playSoundEffect   = false;
     outOfTimeEffect   = false;
     command           = new ResetCommand(Game1.GetInstance);
     gameTimeCounter   = 0;
     textFont          = content.Load <SpriteFont>("TextFont");
     position          = new Vector2(400, 22);
     displayPos        = new Vector2();
     displayVelocity   = new Vector2(0, -2);
     headerKeywords    = "MARIO                                  WORLD             TIME";
     endGame           = false;
     coinTexture       = SpriteFactory.CreateCoin();
     flagScore         = "5000";
     score             = 0;
     coin              = 0;
     time              = 400;
     displayScore      = "";
     headerVariables   = FormatString(score, 6) + "             x" + FormatString(coin, 2) + "                   1-1                  " + FormatString(time, 3);
     counterForEndGame = 0;
 }
コード例 #17
0
 public Background(Game1 game, Vector2 location)
 {
     this.MyGame   = game;
     this.Sprite   = SpriteFactory.CreateBackground();
     this.Location = location;
 }