Ejemplo n.º 1
0
        public static void InitializeShip()
        {
            // get Ship Group
            ShipCol ShipC = (ShipCol)GameObjectMan.Find(200, 200).GameObj;

            // if Ship is in the object pool
            if (ShipC.Reservedchildren.GetHead() != null)
            {
                _ShipMan.Ship = (ShipLeaf)ShipC.Reservedchildren.GetHead();
                ShipC.Reservedchildren.Remove(GetShip());
                UpdateShipPos();
                // next line is necessary
                PlayBatchMan.Find(BatchName.Box).Add(GetShip().CollisionObj.Box);
                PlayBatchMan.Find(BatchName.Box).Add(ShipC.CollisionObj.Box);
            }
            else    // if Ship is not in the object pool. create new Bullet Obj
            {
                _ShipMan.Ship = new ShipLeaf(GameSpriteName.Ship, 400, 100, 200, 201);
                UpdateShipPos();
            }
            GetShip().SetState(StateName.Ready);
            ShipC.Add(GetShip());
        }
Ejemplo n.º 2
0
        public override void Visit(ShipCol a)
        {
            GameObject Ship = (GameObject)Iterator.GetChild(a);

            CollisionPair.Collide(Ship, this);
        }
Ejemplo n.º 3
0
        //Collisions
        public override void Visit(ShipCol a)
        {
            GameObject BumpChild = (GameObject)Iterator.GetChild(this);

            CollisionPair.Collide(a, BumpChild);
        }
Ejemplo n.º 4
0
 public virtual void Visit(ShipCol b)
 {
 }