public void CheckHit(Player player) { if (Source.Intersects(player.Source)) { Visible = false; player._health -= _damage; } }
public void Update(GameTime gameTime, Player player) { if (Vector2.Distance(_startPosition, _position) > MAX_DISTANCE) Visible = false; if (Visible == true) base.UpdateProjectile(gameTime, _speed, _direction); CheckHit(player); }
public override void Initialize(Player player, Level level, Vector2 position, int health, int movementSpeed, int damage, int exp) { _player = player; base.Initialize(level, position, health, damage, movementSpeed, exp); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { //Initialize the player class playerCharacter = new Player(); sampleLevel = new Level(); //Temporary, need to level scanning and automatic adding to the list enemyCharacter = new TheShredder(); enemyList.Add(enemyCharacter); base.Initialize(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { //Initialize the player class playerCharacter = new Player(); sampleLevel = new Level(); enemyCharacter = new TheShredder(); base.Initialize(); }