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)); } }
//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--; } } }
public override void DrinkPotion(Character player) { player.Damage += AmountBonus; }
public override void DrinkPotion(Character player) { player.Energy += AmountBonus; }
public void Defence(Character character) { }
public void Attack(Character character) { character.Life -= this.Damage; }
//Method public abstract void DrinkPotion(Character player);