Beispiel #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());
        }
Beispiel #2
0
        public override void Visit(ShipCol a)
        {
            GameObject Ship = (GameObject)Iterator.GetChild(a);

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

            CollisionPair.Collide(a, BumpChild);
        }
Beispiel #4
0
 public virtual void Visit(ShipCol b)
 {
 }