private void ReceiveDamage(HitData hitData) { _life -= hitData.Damage; if(_life<=0) Kill(); }
public override void OnGotHit(HitData hitData) { //animate hit base.OnGotHit(hitData); ReceiveDamage(hitData); }
public override void OnGotHit(HitData hitData) { const int distributionAngle = 45; float hitAngle = MathHelper.ToDegrees((float) hitData.Rotation) + 180; _engine.ExplosionMaster.AddExplosion(new ExplosionData { NumberOfParticles = 30, MinAngle = (int) hitAngle - distributionAngle, MaxAngle = (int) (hitAngle + distributionAngle), CustomTexture = _hitTexture, MaxAge = 600f, Position = hitData.HitPosition, Size = 40.0f }, hitData.HitTime); }
public override void OnGotHit(HitData hitData) { }
public override void OnGotHit(HitData hitData) { //var tile = new Tile(GeneratedTile, TileCollision.Impassable, _engine.Content.Load<Texture2D>("Sprites/wallhit")); var x = (int) Position.X/Tile.Width; var y = (int)Position.Y / Tile.Height; //_engine.tiles[x, y] = tile; }
public abstract void OnGotHit(HitData hitData);