예제 #1
0
        public static ShieldBlock create(ShieldBlock.LeftTopBlock type, Index index, float x, float y)
        {
            ShieldBlock block;
            if (index.Equals(Index.Index_0))
            {
                block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.LeftTop_0, x, y);
            }
            else if (index.Equals(Index.Index_1))
            {
                block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.LeftTop_1, x, y);
            }
            else if (index.Equals(Index.Index_2))
            {
                block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.LeftTop_2, x, y);
            }
            else
            {
                block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.LeftTop_3, x, y);
            }

            GameObjectManager.insert(block, Instance.root);
            Instance.batch.attach(block.Spr);
            SpriteBatchManager.attachToGroup(block.ColObj.Spr, BatchGroup.BatchType.Collisions);
            return block;
        }
예제 #2
0
 public static ShieldBlock create(ShieldBlock.Block type, Index index, float x, float y)
 {
     ShieldBlock block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.ShieldBlock, x, y);
     GameObjectManager.insert(block, Instance.root);
     Debug.Assert(block.Spr != null);
     Instance.batch.attach(block.Spr);
     SpriteBatchManager.attachToGroup(block.ColObj.Spr, BatchGroup.BatchType.Collisions);
     return block;
 }
예제 #3
0
 public override void visitShield(ShieldBlock v, CollisionPair p)
 {
     p.notify(v, this);
 }
예제 #4
0
 public override void visitShield(ShieldBlock v, CollisionPair p)
 {
     p.collision(v, (GameObject)this.child);
 }
예제 #5
0
 public virtual void visitShield(ShieldBlock v, CollisionPair p)
 {
     Debug.Assert(false, "Shouldn't have been called");
 }
예제 #6
0
        public static ShieldBlock create(ShieldBlock.RightBottomBlock type, Index index, float x, float y)
        {
            ShieldBlock block;
            if (index.Equals(Index.Index_0))
            {
                block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.RightBottom_0, x, y);
            }
            else if (index.Equals(Index.Index_1))
            {
                block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.RightBottom_1, x, y);
            }
            else
            {
                block = null;
            }
            Debug.Assert(block != null);

            GameObjectManager.insert(block, Instance.root);
            Instance.batch.attach(block.Spr);
            SpriteBatchManager.attachToGroup(block.ColObj.Spr, BatchGroup.BatchType.Collisions);
            return block;
        }
예제 #7
0
 public override void visitShield(ShieldBlock v, CollisionPair p)
 {
     GameObject shieldBlock = v;
     while (shieldBlock.Sibling != null)
     {
         shieldBlock = (GameObject)shieldBlock.Sibling;
     }
     p.notify(shieldBlock, this);
 }
예제 #8
0
파일: Visitor.cs 프로젝트: xfanw/Game
 public virtual void Visit(ShieldBlock b)
 {
 }