public void EndGame()
        {
            gameOverScreen = new GameOverScreen(this);
            currentScreen  = Screen.GameOverScreen;

            gamePlayScreen = null;
        }
        public Player(Texture2D tex, Texture2D HUDPic, Vector2 pos, GameWindow window, GamePlayScreen gps, int hp, int mana, int speed, int damage, PlayerIndex playerIndex)
            : base(tex, pos)
        {
            this.HUDPic   = HUDPic;
            this.window   = window;
            this.gps      = gps;
            this.hp       = hp;
            this.mana     = mana;
            this.speed    = speed;
            this.damage   = damage;
            this.oldSpeed = speed;
            this.graphics = graphics;
            this.rumble   = new Rumble(playerIndex);
            notMoved      = true;
            //projectileTimerLife = 2000;
            shootOneAtTime    = true;
            showButtonCounter = true;
            isShooting        = true;
            isArcherMoving    = true;
            isWarriorMoving   = true;

            this.center         = new Vector2(pos.X + frameSize.X / 2, pos.Y + frameSize.Y / 2);
            particleEngineSteam = new ParticleEngine(TextureManager.steamTextures, pos, Color.White);

            this.playerIndex = playerIndex;
        }
        public void StartGame()
        {
            gamePlayScreen = new GamePlayScreen(this);
            currentScreen  = Screen.GamePlayScreen;

            startScreen    = null;
            gameOverScreen = null;
        }
        public void StartScreen()
        {
            startScreen   = new StartScreen(this);
            currentScreen = Screen.StartScreen;

            gameSelectScreen = null;
            gameOverScreen   = null;
            gamePlayScreen   = null;
        }
Пример #5
0
        public EngineerTower(Texture2D tex, Vector2 pos, GamePlayScreen gps, int towerLife)
            : base(tex, pos)
        {
            this.gps       = gps;
            spriteWidth    = 50;
            spriteHeight   = 50;
            this.towerLife = towerLife;

            center = new Vector2(pos.X + spriteWidth / 2, pos.Y + spriteHeight / 2);
            origin = new Vector2(spriteWidth / 2, spriteHeight / 2);
        }
Пример #6
0
        public Archer(Texture2D tex, Texture2D HUDPic, Vector2 pos, GameWindow window, GamePlayScreen gps, int hp, int mana, int speed, int damage, PlayerIndex playerIndex)
            : base(tex, HUDPic, pos, window, gps, hp, mana, speed, damage, playerIndex)
        {
            projTex = TextureManager.arrowBasic;
            this.particleEnginePowerShoot = new ParticleEngine(TextureManager.steamTextures, pos, Color.Yellow);
            this.particleEngineDash       = new ParticleEngine(TextureManager.steamTextures, pos, Color.Yellow);


            #region leapa-kod
            //Kod för att leapa, inte riktigt färdig! Men kan byggas på för att få rätt resultat
            //if (prevThumbStickRightValue.X != 0 || prevThumbStickRightValue.Y != 0)
            //{
            //    jump += prevThumbStickRightValue;
            //    jump.Normalize();
            //    pos += jump * 100;
            //}
            #endregion

            isTransparent       = false;
            isReloading         = false;
            lifeTransparent     = 2000;
            projectileTimerLife = 200;
            offsetBullet        = new Vector2(12, 30);
            frameSize           = new Point(45, 45);
            availableBPress     = true;
            //                                                      name, int, str, agil, vit, luck, hp, mp, lvl
            statusWindow        = new StatusWindow(TextureManager.turretBullet, pos, "hej", 0, 0, 0, 0, 0, hp, mana, 100, playerIndex);
            rainTargetActive    = false;
            rightTriggerPressed = false;
        }
Пример #7
0
        //float oldSpeed;

        public Engineer(Texture2D tex, Texture2D HUDPic, Vector2 pos, GameWindow window, GamePlayScreen gps, int hp, int mana, int speed, int damage, PlayerIndex playerIndex)
            : base(tex, HUDPic, pos, window, gps, hp, mana, speed, damage, playerIndex)
        {
            frameSize           = new Point(45, 45);
            projectileTimerLife = 700;
            teleportPos         = pos;
            projTex             = TextureManager.bulletEng;
            offsetBullet        = new Vector2(-7, 20);
            //oldSpeed = speed;
            //                                                      name, int, str, agil, vit, luck, hp, mp, lvl
            statusWindow = new StatusWindow(TextureManager.turretBullet, pos, "Sebastian", 2, 2, 2, 4, 0, hp, mana, 1, playerIndex);
        }
 public Warrior(Texture2D tex, Texture2D HUDPic, Vector2 pos, GameWindow window, GamePlayScreen gps, int hp, int mana, int speed, int damage, PlayerIndex playerIndex)
     : base(tex, HUDPic, pos, window, gps, hp, mana, speed, damage, playerIndex)
 {
     //                                                      name, int, str, agil, vit, luck, hp, mp, lvl
     statusWindow = new StatusWindow(TextureManager.turretBullet, pos, "hej", 0, 0, 0, 0, 0, hp, mana, 1, playerIndex);
     this.particleEngineCharge = new ParticleEngine(TextureManager.steamTextures, pos, Color.Green);
     frameSize       = new Point(50, 50);
     isAttacking     = false;
     isShielding     = false;
     isCharging      = false;
     isAPress        = false;
     availableAPress = true;
 }
        public Wizard(Texture2D tex, Texture2D HUDPic, Vector2 pos, GameWindow window, GamePlayScreen gps, int hp, int mana, int speed, int damage, PlayerIndex playerIndex)
            : base(tex, HUDPic, pos, window, gps, hp, mana, speed, damage, playerIndex)
        {
            this.timeWindRuch        = 1000;
            this.particleEngineWater = new ParticleEngine(TextureManager.steamTextures, pos, Color.Blue);
            this.particleEngineFire  = new ParticleEngine(TextureManager.steamTextures, pos, Color.Red);
            this.particleEngineRocks = new ParticleEngine(TextureManager.steamTextures, pos, Color.Gray);
            this.damage = 10;

            //                                                      name, int, str, agil, vit, luck, hp, mp, lvl
            statusWindow = new StatusWindow(TextureManager.turretBullet, pos, "Sir Anton", 20, 0, 0, 0, 0, hp, mana, 100, playerIndex);

            projTex             = TextureManager.bulletWiz;
            projectileTimerLife = 500;
            offsetBullet        = new Vector2(-8, 20);
            frameSize           = new Point(45, 45);
        }