public SFXPlayer(Engine.Object source) : base(source) { Add("attack", getSFX("Player Attack"), false); Add("damaged", getSFX("Player Hit"), false); Add("death", getSFX("Player Death"), false); _health = (source as Engine.Player).Health; }
public override void Update(GameTime gameTime, Engine.Object obj) { base.Update(gameTime, obj); var player = obj.World.Player; _healthPercentage = (double)player.Health / player.MaxHealth; }
public Timer(string id, Engine.Object parent) : base(id, parent) { _time = new Engine.TextObject("time", "Hud", this); var _timerFrame = new Engine.TexturedObject("frame", this, new Engine.SpriteSheet("Textures/Hud/TimerFrame")); _timerFrame.Position = new Vector2(-22, -25); Add(_timerFrame); Add(_time); }
public Terror(string id, Engine.Object parent, Engine.SpriteSheet spriteSheet, string chillScreamSFX, string crazyScreamSFX) : base(id, parent, spriteSheet) { _reactionRange = 250; _sprintSpeed = 250; _walkSpeed = 25; _walkLeftBoundary = -96; _walkRightBoudary = 96; _chillScream = Engine.GameInstance.AssetManager.GetSoundEffect(chillScreamSFX); _crazyScream = Engine.GameInstance.AssetManager.GetSoundEffect(crazyScreamSFX); }
public SFXSnowMan(Engine.Object source) : base(source) { Add("attack", getSFX("Medium Enemy Attack"), false); Add("damaged", getSFX("Medium Enemy Hit"), false); Add("death", getSFX("Medium Enemy Death"), false); if (source is EnemySnowMan) { _health = (source as EnemySnowMan).Health; } }
public SFXZombie(Engine.Object source) : base(source) { Add("normalScream", getSFX("Zombie normal(" + Engine.GameInstance.RNG.Next(1, 5) + ")"), true); Add("crazyScream", getSFX("Zombie scream"), true); Add("damaged", getSFX("Small Enemy Hit"), false); Add("attack", getSFX("Small Enemy Attack"), false); if (source is EnemyZombie) { _health = (source as EnemyZombie).Health; } }
public EnemySnowMan(Engine.Object parent) : base("enemySnowMan", parent, new SpriteSheetSnowMan("Textures/Characters/SnowmanThrower")) { _reactionRange = 1500; AttackSpeed = 1800; Damage = 100; Health = 500; Mass = 2; SFXManager = new SFXSnowMan(this); BoundingBox = new Rectangle(0, 0, 112, 116); StaggerDuration = 2000; }
public DescriptionBox(Engine.Object parent, string text) : base("DescriptionBox", parent) { //create TextObject _description = new Engine.TextObject("description", "Hud", this); _description.Text = text; _description.Color = Color.Gray; //create the box and its frame _box = new Engine.TexturedObject("box", this, new Engine.SpriteSheet("Textures/HUD/DescriptionBox")); var textBox = new Rectangle(0, 0, _box.Width - 10, _box.Height); //set boundingBox equal to the boundingBox of box BoundingBox = _box.BoundingBox; //make sure the text fits perfectly into the _textBox and center it _description.FitIntoRectangle(textBox); _description.Position = new Vector2((Width - textBox.Width) / 2, Height / 2 - _description.Height / 2); //add both parts of the descriptionBox in the correct order Add(_box); Add(_description); }
public Enemy(string id, Engine.Object parent, Engine.SpriteSheet spriteSheet) : base(id, parent, spriteSheet) { }
public SliderMusicVolume(Engine.Object parent) : base("sliderVolume", parent, new Engine.SpriteSheet("Textures/HUD/SliderBar"), new Engine.SpriteSheet("Textures/HUD/Slider")) { }
public HealthBar(string id, Engine.Object parent) : base(id, parent) { Add(new Engine.TexturedObject("health", this, new SpriteSheetHealthBar("Textures/HUD/HealthFilling"))); Add(new Engine.TexturedObject("frame", this, new Engine.SpriteSheet("Textures/HUD/HealthBorder"))); }