Exemplo n.º 1
0
        public ShipManager(Game game, PlayerIndex playerIndex)
        {
            shipList           = new List <Gryffon>();
            numShips           = 4;
            numActiveShips     = numShips;
            currentPlayerIndex = playerIndex;
            //Initialize ships
            for (int i = 0; i < numShips; i++)
            {
                //Put ships into a default (no) formation
                shipList.Add(new Gryffon(Vector2.Zero, game));
                shipList[i].rotateAboutFixedPoint = true;
                shipList[i].color = (currentPlayerIndex == PlayerIndex.One) ? Color.PowderBlue : Color.Red;
            }

            formationManager = new FormationManager(game, numShips,
                                                    shipList[0].texture.Width,
                                                    shipList[0].texture.Height,
                                                    currentPlayerIndex);

            //Set the default location of the fixed point
            fixedPoint = Vector2.Zero;

            //Set the default formation
            curFormation = formationManager.currentFormation;

            //Make the current formation public
            Defines.playersGestures.Add(playerIndex, curFormation.ID);
            //Make the current fusion mode public
            Defines.playerFusionTriggered.Add(playerIndex, formationManager.gestureComponent.fusionGestureMode);
        }
Exemplo n.º 2
0
        public ShipManager(Game game, PlayerIndex playerIndex)
        {
            shipList = new List<Gryffon>();
            numShips = 4;
            numActiveShips = numShips;
            currentPlayerIndex = playerIndex;
            //Initialize ships
            for (int i = 0; i < numShips; i++)
            {
                //Put ships into a default (no) formation
                shipList.Add(new Gryffon(Vector2.Zero, game));
                shipList[i].rotateAboutFixedPoint = true;
                shipList[i].color = (currentPlayerIndex == PlayerIndex.One) ? Color.PowderBlue : Color.Red;
            }

            formationManager = new FormationManager(game, numShips,
                shipList[0].texture.Width,
                shipList[0].texture.Height,
                currentPlayerIndex);

            //Set the default location of the fixed point
            fixedPoint = Vector2.Zero;

            //Set the default formation
            curFormation = formationManager.currentFormation;

            //Make the current formation public
            Defines.playersGestures.Add(playerIndex, curFormation.ID);
            //Make the current fusion mode public
            Defines.playerFusionTriggered.Add(playerIndex, formationManager.gestureComponent.fusionGestureMode);
        }