// 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); }
public ShipController(Ship ship) { if(ship != null) { theShip = ship; } }
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; }
// Variables public ShipControllerPlayer(Ship ship) : base(ship) { theShip = ship; }