コード例 #1
0
ファイル: MonsterEgg.cs プロジェクト: JonSaffron/Labyrinth
 private void EggIsHatching(object sender, EventArgs args)
 {
     if (this.IsExtant)
     {
         this._animationPlayer = new LoopedAnimation(this, "Sprites/Monsters/Egg", 2);
         this.PlaySoundWithCallback(GameSound.EggHatches, HatchingSoundFinished);
     }
 }
コード例 #2
0
 public ForceField(Vector2 position, int crystalRequired) : base(position)
 {
     this._forceFieldState = new ActiveState(this);
     this._crystalRequired = crystalRequired;
     this._animationPlayer = new LoopedAnimation(this, "Sprites/Props/ForceField", 6);
     this.Properties.Set(GameObjectProperties.EffectOfShot, EffectOfShot.Reflection);
     this.Properties.Set(GameObjectProperties.DrawOrder, (int)SpriteDrawOrder.ForceField);
     this.Properties.Set(GameObjectProperties.DeadlyToTouch, true);
 }
コード例 #3
0
 public Crystal(Vector2 position, int id, int score, int energy) : base(position)
 {
     this.CrystalId        = id;
     this.Score            = score;
     this.Energy           = energy;
     this._animationPlayer = new LoopedAnimation(this, "Sprites/Crystal/Crystal", 8);
     this.Properties.Set(GameObjectProperties.EffectOfShot, EffectOfShot.Intangible);
     this.Properties.Set(GameObjectProperties.DrawOrder, (int)SpriteDrawOrder.StaticItem);
 }
コード例 #4
0
ファイル: MonsterEgg.cs プロジェクト: JonSaffron/Labyrinth
        public MonsterEgg(MonsterDef underlyingMonster, int timeToHatch) : base(underlyingMonster.Position)
        {
            this._underlyingMonster = underlyingMonster;
            this.Energy             = underlyingMonster.Energy;
            this._animationPlayer   = new LoopedAnimation(this, "Sprites/Monsters/Egg", 6);
            var timeSpan = TimeSpan.FromSeconds(timeToHatch * Constants.GameClockResolution);

            this._hatchingTimer = GameTimer.AddGameTimer(timeSpan, EggIsHatching, false);
            this.Properties.Set(GameObjectProperties.DrawOrder, (int)SpriteDrawOrder.StaticMonster);
            this.Properties.Set(GameObjectProperties.Solidity, ObjectSolidity.Stationary);
        }
コード例 #5
0
 public PrimedState(Mine mine) : base(mine)
 {
     this._animationPlayer = new LoopedAnimation(mine, "Sprites/Shot/MineArmed", 48);
     mine.PlaySound(GameSound.MineArmed);
 }
コード例 #6
0
 public Potion(Vector2 position) : base(position)
 {
     this._animationPlayer = new LoopedAnimation(this, "Sprites/Flask", 48);
 }