Exemplo n.º 1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            lander           = new Lander();
            lander.img       = Content.Load <Texture2D>("ship");
            lander.imgEngine = Content.Load <Texture2D>("engine");

            lander.position = new Vector2(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2);
        }
Exemplo n.º 2
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()
        {
            lander     = new Lander();
            paddle     = new Paddle(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
            outcome    = -1;
            rotationUI = new UIText(20, 10, "Rotation", "0");
            vxUI       = new UIText(20, 40, "H-Speed", "0");
            vyUI       = new UIText(20, 70, "V-Speed", "0");
            resultUI   = new UIText(20, 100, "", "");

            base.Initialize();
        }
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            lander = new Lander
            {
                position  = new Vector2(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2),
                shipImg   = Content.Load <Texture2D>("ship"),
                engineImg = Content.Load <Texture2D>("engine"),
            };
        }