Ejemplo n.º 1
0
        // Functions
        public GameplayState()
        {
            // Create player ship.
            playerShip = new Ship();
            playerShip.X = 100;
            playerShip.Y = 100;
            playerController = new ShipControllerPlayer(playerShip);
            playerShip.ChangeShipController(playerController);

            // Create starfield.
            starFieldFar = new Image(Assets.GFX_STARFIELD);
            starFieldFar.Repeat = true;
            starFieldFar.Scroll = 0.3f;
            starFieldMid = new Image(Assets.GFX_STARFIELD);
            starFieldMid.Repeat = true;
            starFieldMid.Scroll = 0.6f;
            starFieldMid.Scale = 1.5f;
            starFieldClose = new Image(Assets.GFX_STARFIELD);
            starFieldClose.Repeat = true;
            starFieldClose.Scroll = 1.3f;
            starFieldClose.Scale = 3.0f;
            starFieldClose.Alpha = 0.5f;

            AddGraphic(starFieldFar);
            AddGraphic(starFieldMid);
            Add(playerShip);
            AddGraphic(starFieldClose);
        }
Ejemplo n.º 2
0
 public ShipController(Ship ship)
 {
     if(ship != null)
     {
         theShip = ship;
     }
 }
Ejemplo n.º 3
0
 public CannonShot(Ship parentShip, float Ang, int Level, Speed AddSpeed)
 {
     AdditionalSpeed = AddSpeed;
     LaserLevel = Level;
     Graphic = new Image(Assets.GFX_FX_LASER);
     Graphic.CenterOrigin();
     Graphic.Angle = 360 - Ang;
     myParent = parentShip;
     X = myParent.X;
     Y = myParent.Y;
 }
Ejemplo n.º 4
0
 // Variables
 public ShipControllerPlayer(Ship ship)
     : base(ship)
 {
     theShip = ship;
 }