Пример #1
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();
        }