Esempio n. 1
0
        /// <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()
        {
            screenHeight = 800;
            screenWidth  = 1600;
            graphics.PreferredBackBufferHeight = screenHeight;
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.ApplyChanges();
            this.IsMouseVisible = true;

            station = new Station(new Vector2(0, 0));
            planets = new PlanetColecction();

            player = new Player(planets.Planets[0], screenWidth, screenHeight, 200);
            player.startBuild(screenWidth * .5f, screenHeight * .5f);

            pickups = new PickupManager();
            camera  = new Camera(screenWidth * 0.5f, screenHeight * .5f, 0.75f, screenWidth, screenHeight);

            astroroids = new AstroroidManager();
            stars      = new StarManager(camera);
            screen     = Screen.build;
            base.Initialize();
        }
Esempio n. 2
0
 public void DrawHud(int x, int y, SpriteBatch spriteBatch, Texture2D fill, Texture2D sphere, SpriteFont font, AstroroidManager astroroids, PlanetColecction planets)
 {
     DrawRadar(spriteBatch, fill, sphere, ship.Locaion, x, y, astroroids.GetAstroroidList(), planets.Planets);
     spriteBatch.DrawString(font, "Credits: " + credits, new Vector2(20, 20), Color.Green);
 }