Пример #1
0
 public AGameObject GetGameObject(AGameObject gameObject, BonusEffect bonus = BonusEffect.NONE)
 {
     if (bonus == BonusEffect.BANG)
     {
         return(new BangGameObject(gameObject));
     }
     return(new SimpleGameObject(gameObject, RandomSpriteName()));
 }
Пример #2
0
        private void KillItem(AGameObject item)
        {
            switch (item.Bonus)
            {
            case BonusEffect.BANG:
                ((BangGameObject)item).Kill();
                break;

            case BonusEffect.NONE:
                item.Kill();
                break;
            }
        }
Пример #3
0
        public AGameObject(Rectangle region, SpriteName spriteName, GameMatrix parent, AGameObject left = null, AGameObject right = null, AGameObject top = null, AGameObject bottom = null)
        {
            Region = region;

            this.Parent = parent;

            NewPosition = new Point(region.X, region.Y);

            SpriteName = spriteName;

            Left   = left;
            Right  = right;
            Top    = top;
            Bottom = bottom;

            Visible = true;

            if (Left != null)
            {
                Left.Right = this;
            }
            if (Right != null)
            {
                Right.Left = this;
            }
            if (Top != null)
            {
                Top.Bottom = this;
            }
            if (Bottom != null)
            {
                Bottom.Top = this;
            }

            AnimationState      = SpriteAnimationState.SHOW;
            SpriteAnimationStep = 8;

            gFactory = GameObjectFactory.GetInstance();
            gc       = GameConfigs.GetInstance();
        }
Пример #4
0
 public AGameObject(AGameObject item, SpriteName sprite) : this(item.Region, sprite, item.Parent, item.Left, item.Right, item.Top, item.Bottom)
 {
 }
Пример #5
0
 public BangGameObject(AGameObject item) : base(item, item.SpriteName)
 {
     Bonus = BonusEffect.BANG;
 }
Пример #6
0
 public SimpleGameObject(Rectangle region, SpriteName spriteName, GameMatrix parent, AGameObject left = null, AGameObject right = null, AGameObject top = null, AGameObject bottom = null)
     : base(region, spriteName, parent, left, right, top, bottom)
 {
 }
Пример #7
0
 public LineGameObject(AGameObject item, LineType lt) : base(item, item.SpriteName)
 {
     Bonus = lt == LineType.H ? BonusEffect.LINE_H : BonusEffect.LINE_V;
 }
Пример #8
0
 public AGameObject GetGameObject(Rectangle region, GameMatrix parent, AGameObject left = null, AGameObject right = null, AGameObject top = null, AGameObject bottom = null)
 {
     return(new SimpleGameObject(region, RandomSpriteName(), parent, left, right, top, bottom));
 }
Пример #9
0
 public AGameObject GetGameObject(AGameObject cloned, LineType type)
 {
     return(new LineGameObject(cloned, type));
 }