Created
March 4, 2013 06:26
-
-
Save anonymous/5080362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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