Skip to content

Instantly share code, notes, and snippets.

Created March 4, 2013 06:26
Show Gist options
  • Save anonymous/5080362 to your computer and use it in GitHub Desktop.
Save anonymous/5080362 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace ShipGame
{
class MiniBoss : EnemyShip
{
public int MaxHealth = 240;
public MiniBoss(string textureName, Vector2 startingPosition, int health)
: base(textureName, startingPosition, health)
{
Health = 240;
}
public MiniBoss(string textureName, Vector2 startingPosition)
: base(textureName, startingPosition) { }
public override void TakeDamage(int amount)
{
base.TakeDamage(MaxHealth/12);
}
public override void Collide(Actor actor)
{
int health = Health;
// Order is important
actor.TakeDamage(Health);
TakeDamage(health);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment