/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { base.Initialize(); font = GameApp.instance.Content.Load <SpriteFont>("Font"); // TODO: use this.Content to load your game content here // Setting up Screen Resolution // Read more here: http://rbwhitaker.wikidot.com/changing-the-window-size graphics.PreferredBackBufferWidth = 640; graphics.PreferredBackBufferHeight = 480; graphics.IsFullScreen = false; graphics.ApplyChanges(); Player1 = new PlayerShip(); Player1.Position = new Vector2(300, 300); // a1 = new SmallAsteroid(); // a1.Position = new Vector2(200, 200); // a2 = new Asteroid(); // a2.Position = new Vector2(150, 150); a3 = new LargeAsteroid(); // a3.Position = new Vector2(100, 100); }
public override void OnDestroy() { LargeAsteroid newLarge = new LargeAsteroid(); Asteroid newMedium = new Asteroid(); newMedium.Position = this.Position; newMedium.Velocity = this.Velocity; //create 2 medium asteroids }