Exemple #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();
        }
Exemple #2
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));
 }
 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)
 {
 }
Exemple #4
0
 public AGameObject GetGameObject(int x, int y, GameMatrix parent)
 {
     return(new SimpleGameObject(new Rectangle(x, y, 256, 256), RandomSpriteName(), parent));
 }