/// <summary> /// Initializes a new instance of the <see cref="Dwarf"/> class. /// </summary> /// <param name="game">Reference to the <see cref="Game"/> instance.</param> public Dwarf(Game game) : base(game, Resources.yaakov_right4) { this.Hitpoints = this.MaximumHitpoints; this.Nitroglycerin = 3; this.PickaxeLevel = PickaxeType.Iron; this.FaceDirection = FaceDirection.Right; }
/// <summary> /// Initializes a new instance of the <see cref="SoundComponent"/> class. /// </summary> /// <param name="game">Reference to the <see cref="Game"/> instance.</param> public SoundComponent(Game game) : base(game) { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { this.player = new WavePlayer(); this.indexDictionary.Add(Sound.Hurt, this.player.Load(new MemoryStream(Resources.hurt))); this.indexDictionary.Add(Sound.Pause, this.player.Load(new MemoryStream(Resources.pause))); this.indexDictionary.Add(Sound.Pickaxe, this.player.Load(new MemoryStream(Resources.pickaxe))); this.indexDictionary.Add(Sound.Nitroglycerin, this.player.Load(new MemoryStream(Resources.nitroglycerin))); } }
/// <summary> /// Initializes a new instance of the <see cref="FallingObjectComponent"/> class. /// </summary> /// <param name="game">Reference to the <see cref="Game"/> instance.</param> public FallingObjectComponent(Game game) : base(game) { this.fallingObjectSet.Add(FallingObject.Rock, 0.85m); this.fallingObjectSet.Add(FallingObject.MedicalKit, 0.15m); this.fallingObjectSet.Add(FallingObject.Nitroglycerin, 0.1m); this.oresAndMetalsSet.Add(OresAndMetals.Boulder, 0.3m); this.oresAndMetalsSet.Add(OresAndMetals.Coal, 0.3m); this.oresAndMetalsSet.Add(OresAndMetals.Tin, 0.2m); this.oresAndMetalsSet.Add(OresAndMetals.Copper, 0.2m); this.oresAndMetalsSet.Add(OresAndMetals.Iron, 0.15m); this.oresAndMetalsSet.Add(OresAndMetals.Mithril, 0.04m); this.oresAndMetalsSet.Add(OresAndMetals.Densium, 0.01m); }
/// <summary> /// Initializes a new instance of the <see cref="GameComponent"/> class. /// </summary> /// <param name="game">Reference to the <see cref="Game"/> instance.</param> protected GameComponent(Game game) { this.Game = game; }
/// <summary> /// Initializes a new instance of the <see cref="NitroglycerinCrate"/> class. /// </summary> /// <param name="game">Reference to the <see cref="Game"/> instance.</param> public NitroglycerinCrate(Game game) : base(game, Resources.nitroglycerin_crate) { this.ContainsVial = true; }
/// <summary> /// Initializes a new instance of the <see cref="PhysicsComponent"/> class. /// </summary> /// <param name="game">Reference to the <see cref="Game"/> instance.</param> public PhysicsComponent(Game game) : base(game) { }
/// <summary> /// Instantiates and initializes the game. /// </summary> /// <param name="e">The event arguments.</param> protected override void OnLoad(EventArgs e) { this.game = new Game(); this.game.Initialize(this.ClientSize); }
/// <summary> /// Initializes a new instance of the <see cref="DisplayComponent"/> class. /// </summary> /// <param name="game">Reference to the <see cref="Game"/> instance.</param> public DisplayComponent(Game game) : base(game) { this.font = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular); }
/// <summary> /// Initializes a new instance of the <see cref="MedicalCrate"/> class. /// </summary> /// <param name="game">Reference to the <see cref="Game"/> instance.</param> public MedicalCrate(Game game) : base(game, Resources.medical_crate) { Random random = new Random(); this.Healing = random.GenerateNumber(50, 200); }
/// <summary> /// Initializes a new instance of the <see cref="GameObject"/> class. /// </summary> /// <param name="game">Reference to the <see cref="Game"/> instance.</param> /// <param name="sprite">The image representing the game object.</param> protected GameObject(Game game, Image sprite) : base(game) { this.Sprite = sprite; }