public FlagPole(Game1 game, Vector2 location) { this.MyGame = game; this.Sprite = SpriteFactory.CreateFlagPole(); MyGame.Sprite = Sprite; this.Location = location; }
public FireworkClass(Game1 game, Vector2 location) { this.MyGame = game; this.Sprite = SpriteFactory.CreateFirework(); MyGame.Sprite = Sprite; this.Location = location; }
public Sun(Game1 game, Vector2 location) { MyGame = game; Sprite = SpriteFactory.CreateSun(); Location = location; count = 0; }
public Flower(Game1 game, Vector2 location) { MyGame = game; Sprite = SpriteFactory.CreateFlower(); MyGame.Sprite = Sprite; HasBeenUsed = false; this.Location = location; }
public EnergyDrink(Game1 game, Vector2 location) { MyGame = game; Sprite = SpriteFactory.CreateEnergyDrink(); MyGame.Sprite = Sprite; HasBeenUsed = false; this.Location = location; }
public Missle(Game1 game, Vector2 location) { MovingLeft = true; IsFalling = true; MyGame = game; Sprite = SpriteFactory.CreateMissle(); CanAttack = true; Location = location; }
public Coin(Game1 game, Vector2 location) { MyGame = game; Sprite = SpriteFactory.CreateCoin(); MyGame.Sprite = this.Sprite; playSoundEffect = false; HasBeenUsed = false; Location = location; }
public Star(Game1 game, Vector2 location) { MyGame = game; Sprite = SpriteFactory.CreateStar(); MyGame.Sprite = Sprite; HasBeenUsed = false; MovingLeft = false; IsFalling = true; this.Location = location; }
public Nami(Game1 game, Vector2 location) { MovingLeft = true; IsFalling = true; MyGame = game; Sprite = SpriteFactory.CreateNami(); CanAttack = true; Location = location; up = true; }
public GodMushroom(Game1 game, Vector2 location) { MovingLeft = false; MyGame = game; Sprite = SpriteFactory.CreateGodMushroom(); IsFalling = true; MyGame.Sprite = Sprite; HasBeenUsed = false; this.Location = location; }
public Goomba(Game1 game, Vector2 location) { MovingLeft = true; IsFalling = true; MyGame = game; Sprite = SpriteFactory.CreateGoomba(); CanAttack = true; playDeathSoundEffect = false; Location = location; dead = false; }
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; }
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); } } }
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(); }
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)); }
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; }
public Background(Game1 game, Vector2 location) { this.MyGame = game; this.Sprite = SpriteFactory.CreateBackground(); this.Location = location; }