Exemple #1
0
 public static void SpawnBoss()
 {
     bossSpawn         = true;
     RightGame.HasMobs = false;
     RightGame.AddMob(LargeBoss);
     RightGame.MaxHeight = LargeBoss.MobHeight + Boss.BOSS_STOP_Y * (3 / 2f);
 }
Exemple #2
0
 public override void Fire(int x, int y)
 {
     RightGame.AddProjectile(new Projectile(bulletTexture, Color.Red, x, y, ProjectileWidth, ProjectileHeight, new Vector2(.4f, 1) * PROJECTILE_SPEED, 1, true));
     RightGame.AddProjectile(new Projectile(bulletTexture, Color.Red, x, y, ProjectileWidth, ProjectileHeight, new Vector2(-.4f, 1) * PROJECTILE_SPEED, 1, true));
     RightGame.AddProjectile(new Projectile(bulletTexture, Color.Red, x, y, ProjectileWidth, ProjectileHeight, new Vector2(0f, 1) * PROJECTILE_SPEED, 1, true));
     shootSound.Play(.2f, -0f, 0f);
 }
Exemple #3
0
 public override void Fire(int x, int y)
 {
     if (timer > RELOAD_DURATION)
     {
         timer = 0;
         RightGame.AddProjectile(new Projectile(bulletTexture, Color.Red, x, y, ProjectileWidth, ProjectileHeight, new Vector2(0, -1) * PROJECTILE_SPEED, WEAPON_DAMAGE, false));
         shootSound.Play(.1f, 0f, 0f);
     }
 }
Exemple #4
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            right       = new RightGame(graphics, spriteBatch, this);
            right.LoadContent();
            left = new LeftGame(graphics, spriteBatch, this);
            left.LoadContent();
            title                = Content.Load <Texture2D>("Title");
            hp                   = new HealthPool(Content.Load <Texture2D>("Heart"), Content.Load <SoundEffect>("GameSounds/playerdamage"), this, 42, 36, 10);
            switchTexture        = Content.Load <Texture2D>("Switcharoo");
            switchTexturePrime   = Content.Load <Texture2D>("SwitcharooSwitch");
            reverseTexture       = Content.Load <Texture2D>("Reversearoo");
            swapTexture          = Content.Load <Texture2D>("Swaparoo");
            timerFont            = Content.Load <SpriteFont>("timerSpritefont");
            fade                 = Content.Load <Texture2D>("Fade");
            pause                = Content.Load <Texture2D>("Pause");
            progress             = Content.Load <Texture2D>("Progress");
            emptyProgressCirle   = Content.Load <Texture2D>("UnfilledCircle");
            filledProgressCircle = Content.Load <Texture2D>("FilledCircle");
            explosionSound       = Content.Load <SoundEffect>("GameSounds/Explosion");
            bossMarker           = Content.Load <Texture2D>("BossLabel");
            gameOverBG1          = Content.Load <Texture2D>("GameOverBG");
            countDown            = new Texture2D[3];
            countDown[0]         = Content.Load <Texture2D>("1");
            countDown[1]         = Content.Load <Texture2D>("2");
            countDown[2]         = Content.Load <Texture2D>("3");
            Texture2D  buttonTexture = Content.Load <Texture2D>("Button");
            SpriteFont buttonFont    = Content.Load <SpriteFont>("ButtonFont");

            gameOverFont = Content.Load <SpriteFont>("GameOverSpritefont");
            gameOverMes  = gameOverFont.MeasureString("Game Over");
            instructions = Content.Load <Texture2D>("Instructions");
            SoundEffect buttonClick = Content.Load <SoundEffect>("GameSounds/click");

            victoryExplosion              = Content.Load <Texture2D>("DeadBoss");
            mainMenuPlay                  = new Button(buttonTexture, WIDTH / 2 - 400 / 2, 325, 400, 150, buttonClick, buttonFont, "Play");
            mainMenuPlay.OnClick         += MainMenuPlayClick;
            mainMenuExit                  = new Button(buttonTexture, WIDTH / 2 - 400 / 2, 675, 400, 150, buttonClick, buttonFont, "Exit");
            mainMenuExit.OnClick         += () => { Exit(); };
            mainMenuInstructions          = new Button(buttonTexture, WIDTH / 2 - 400 / 2, 500, 400, 150, buttonClick, buttonFont, "Instructions");
            mainMenuInstructions.OnClick += () => { gameState = GameState.InstructionMenu; };
            pauseMenuResume               = new Button(buttonTexture, WIDTH / 2 - 400 / 2, 325, 400, 200, buttonClick, buttonFont, "Play");
            pauseMenuResume.OnClick      += PauseMenuResumeClick;
            pauseMenuMainMenu             = new Button(buttonTexture, WIDTH / 2 - 400 / 2, 600, 400, 200, buttonClick, buttonFont, "Main Menu");
            pauseMenuMainMenu.OnClick    += () => { gameState = GameState.MainMenu; };
            instructionMainMenu           = new Button(buttonTexture, WIDTH - 315, HEIGHT - 140, 250, 100, buttonClick, buttonFont, "Main Menu");
            instructionMainMenu.OnClick  += () => { gameState = GameState.MainMenu; };
            gameOverExit                  = new Button(buttonTexture, WIDTH - 300 - 50, HEIGHT - 150 - 50, 300, 150, buttonClick, buttonFont, "Exit");
            gameOverExit.OnClick         += () => { Exit(); };
            gameOverPlayAgain             = new Button(buttonTexture, WIDTH / 2 - 300 / 2, HEIGHT - 150 - 50, 300, 150, buttonClick, buttonFont, "Play Again");
            gameOverPlayAgain.OnClick    += () => { gameState = GameState.Game; };
            gameOverMainMenu              = new Button(buttonTexture, 100 / 2, HEIGHT - 150 - 50, 300, 150, buttonClick, buttonFont, "Main Menu");
            gameOverMainMenu.OnClick     += () => { gameState = GameState.MainMenu; };
            switcharooSound               = Content.Load <SoundEffect>("GameSounds/switcharoo");
            gameOverSound                 = Content.Load <SoundEffect>("GameSounds/lose");
        }
Exemple #5
0
        private static void SpawnEnemy(MobSpawn spawn)
        {
            MobType type = spawn.Type;
            int     x    = (int)spawn.Location.X;
            int     y    = (int)spawn.Location.Y;

            switch (type)
            {
            case MobType.BasicMob:
                RightGame.AddMob(new BasicMob(basicEnemyTexture, noShootAnimations, 43, 42, new Vector2(x, y), 4, 43, 42));
                break;

            case MobType.LargeBoss:
                SpawnBoss();
                break;

            case MobType.ShootMob:
                Weapon shootWeapon = new MobWeapon(mobBulletTexture, mobShoot);
                RightGame.AddMob(new ShootingMob(basicShootingTexture, shootAnimations, 43, 42, new Vector2(x, y), 4, 43, 42, shootWeapon));
                break;

            case MobType.FastMob:
                RightGame.AddMob(new BasicMob(basicEnemyTexture, noShootAnimations, 43, 42, new Vector2(x, y), 8, 43, 42));
                break;

            case MobType.SideMob:
                int flip = 1;
                if (spawn.Rotation != 0)
                {
                    flip = -1;
                }
                Weapon sideWeapon = new SideWeapon(mobBulletTexture, mobShoot, flip);
                RightGame.AddMob(new SideMob(basicShootingTexture, shootAnimations, 43, 42, new Vector2(x, y), 4, 43, 42, sideWeapon, flip));
                break;
            }
        }
Exemple #6
0
 public void Fire2(int x, int y, float velX)
 {
     RightGame.AddProjectile(new Projectile(bulletTexture, Color.Red, x, y, ProjectileWidth, ProjectileHeight, new Vector2(velX / 2, PROJECTILE_SPEED), 1, true));
     shootSound.Play(.2f, -0f, 0f);
 }
Exemple #7
0
 public void Fire(int x, int y, int ySpeed)
 {
     RightGame.AddProjectile(new Projectile(bulletTexture, Color.Red, x, y, ProjectileWidth, ProjectileHeight, new Vector2(dir * PROJECTILE_SPEED, ySpeed), 1, true));
     shootSound.Play(.1f, -1f, 0f);
 }