Exemple #1
0
 internal static Ship ShipFactory()
 {
     Ship newShip = shipPool.GetNew() as Ship;
     newShip.Location = new Vector2(View.GameView.PlayArea.Width / 2, View.GameView.PlayArea.Height / 2);
     newShip.Renderer = null;
     return newShip;
 }
Exemple #2
0
        public Ship ShipFactory()
        {
            Ship newShip = shipPool.GetNew() as Ship;

            newShip.Location = new Vector2(View.GameView.PlayArea.Width / 2, View.GameView.PlayArea.Height / 2);
            newShip.Renderer = null;
            _inputManager.CommandReceived -= newShip.CommandReceivedHandler;
            _inputManager.CommandReceived += newShip.CommandReceivedHandler;
            return(newShip);
        }
Exemple #3
0
        internal static Asteroid AsteroidFactory()
        {
            Asteroid newAsteroid = asteroidPool.GetNew() as Asteroid;

            int size = GameModel.Random.Next(AsteroidMinSize, AsteroidMaxSize);
            newAsteroid.Height = size;
            newAsteroid.Width = size;
            newAsteroid.Stage = AsteroidInitialStage;
            newAsteroid.Style = GameModel.Random.Next(1, 4);
            newAsteroid.Renderer = null;

            return newAsteroid;
        }
Exemple #4
0
        internal static Planet PlanetFactory(Vector2 location, Planets ID)
        {
            Planet newPlanet = planetPool.GetNew() as Planet;
            newPlanet.PlanetID = ID;
            newPlanet.Location = location;

            int size = GameModel.Random.Next(PlanetMinSize, PlanetMaxSize);
            newPlanet.Height = size;
            newPlanet.Width = size;
            newPlanet.Renderer = null;

            return newPlanet;
        }
Exemple #5
0
        internal static Laser LaserFactory(Ship ship)
        {
            Laser newLaser = laserPool.GetNew() as Laser;
            if (ship != null)
            {
                newLaser.Owner = ship.Owner;

                newLaser.Location = new Vector2(ship.Location.X, ship.Location.Y);
                newLaser.Height = LaserHeight;
                newLaser.Width = LaserWidth;
                newLaser.Orientation = ship.Orientation;
                newLaser.Velocity = ship.Velocity + thrustVector(LaserSpeed, ship.Orientation);
            }
            newLaser.Renderer = null;

            return newLaser;
        }