示例#1
0
        public GameState(GraphicsDeviceManager graphics)
        {
            this.graphics = graphics;
            mplayer = new WMPLib.WindowsMediaPlayer();
            Directory.GetCurrentDirectory();
            mplayer.URL = Path.GetDirectoryName(Assembly.GetEntryAssembly().CodeBase) + @"\Content\songs\mele.mp3";
            mplayer.settings.setMode("loop", true);
            mplayer.controls.stop();
            rand = new Random();
            one = GameState.playerNow;

            enemies = new List<Mob>();
            one.MaxWidth = 4000;
            one.MaxHeight = 2500;
            one.Pics = new Texture2D[4];
            boss = new Boss(2000, 2000);
            one.Speed += 5;
            boss.Speed = (float)2.41;
            Initialize();
            input = new InputHandler(graphics);
            enemiesRect = new List<Rectangle>();
            enemiesSourceRect = new List<Rectangle>();

            for (int i = 0; i < enemies.Count; i++)
            {

                enemiesSourceRect.Add(new Rectangle(270 * enemies[i].Frame, 0, 270, 165));
                enemiesRect.Add(new Rectangle((int)enemies[i].X, (int)enemies[i].Y, 270, 165));
            }
        }
示例#2
0
        //TODO: this shit
        public void PlayerMovement(Character player, bool test)
        {
            if (test)
            {
                if (Keyboard.GetState().IsKeyDown(Keys.W))
                {
                    player.IsMovingUp = true;
                }
                if (Keyboard.GetState().IsKeyDown(Keys.S))
                {
                    player.IsMovingDown = true;
                }
                if (Keyboard.GetState().IsKeyDown(Keys.A))
                {
                    player.IsMovingLeft = true;
                }
                if (Keyboard.GetState().IsKeyDown(Keys.D))
                {
                    player.IsMovingRight = true;
                }
                if (Keyboard.GetState().IsKeyDown(Keys.Z))
                {
                    GameState.zoom++;
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.X))
                {
                    GameState.zoom--;

                }
            }
            else
            {
                if (Keyboard.GetState().IsKeyDown(Keys.Up))
                {
                    player.IsMovingUp = true;
                }
                if (Keyboard.GetState().IsKeyDown(Keys.Down))
                {
                    player.IsMovingDown = true;
                }
                if (Keyboard.GetState().IsKeyDown(Keys.Left))
                {
                    player.IsMovingLeft = true;
                }
                if (Keyboard.GetState().IsKeyDown(Keys.Right))
                {
                    player.IsMovingRight = true;
                }
                if (Keyboard.GetState().IsKeyDown(Keys.Z))
                {
                    GameState.zoom++;
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.X))
                {
                    GameState.zoom--;

                }
            }
        }
示例#3
0
 public override void DrinkPotion(Character player)
 {
     player.Damage += AmountBonus;
 }
示例#4
0
 public override void DrinkPotion(Character player)
 {
     player.Energy += AmountBonus;
 }
示例#5
0
 public void Defence(Character character)
 {
 }
示例#6
0
 public void Attack(Character character)
 {
     character.Life -= this.Damage;
 }
示例#7
0
 public void Defence(Character character)
 {
 }
示例#8
0
 public void Attack(Character character)
 {
     character.Life -= this.Damage;
 }
示例#9
0
 //Method
 public abstract void DrinkPotion(Character player);