Exemple #1
0
        protected override void Initialize()
        {
            //Initialize the variable in GlobalClass
            GlobalClass.ScreenWidth = graphics.GraphicsDevice.Viewport.Width;
            GlobalClass.ScreenHeight = graphics.GraphicsDevice.Viewport.Height;

            //Initialize the player
            player = new Animation(Content.Load<Texture2D>(@"Textures/ExportSmallCharacter1"), new Vector2(0, 65), 65, 125);

            //Initialize the ship
            ship = new Ship(Content.Load<Texture2D>(@"Textures/Ship"), new Vector2(GlobalClass.ScreenWidth / 2, GlobalClass.ScreenHeight / 2));
            ship.BulletTexture(Content.Load<Texture2D>(@"Textures/Bullet"));

            //Initialize the camera
            camera = new Camera(GraphicsDevice.Viewport);

            //Initialize the background
            backgroundTexture = Content.Load<Texture2D>(@"Textures/StarBackground");
            backgroundPosition = new Vector2(0, 0);

            // Make sure the mouse is visible
            IsMouseVisible = true;

            base.Initialize();
        }