Exemple #1
0
        public void StartGame()
        {
            gamescreen = new GameScreen(this);
            currentGameState = GameState.GameScreen;

            titlescreen = null;
        }
Exemple #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            titlescreen = new TitleScreen(this);
            currentGameState = GameState.TitleScreen;

            // TODO: use this.Content to load your game content here
            //mSprite.LoadContent(this.Content, "WizardSquare");
            //mSprite.Position = new Vector2(125, 245);
            //mSprite.Position.X = GraphicsDevice.Viewport.Width / 2 - 50;
            //mSprite.Position.Y = GraphicsDevice.Viewport.Height / 2 - 50;

            // BACKGROUND
            mScrollingBackground = new HorizontallyScrollingBackground(this.GraphicsDevice.Viewport);
            mScrollingBackground.AddBackground("Background01");
            mScrollingBackground.AddBackground("Background02");
            mScrollingBackground.AddBackground("Background03");
            mScrollingBackground.AddBackground("Background04");
            mScrollingBackground.AddBackground("Background05");

            mScrollingBackground.LoadContent(this.Content);

            // TODO: use this.Content to load your game content here
            cakeTexture = Content.Load<Texture2D>("Platform");

            player = new Sprite();
            player.Texture = Content.Load<Texture2D>("WizardSquare");
            player.SetRelativeBoundingBox(20, 74, player.Texture.Width - 50, 20);

            player.Position = new Vector2(
                0,
                GraphicsDevice.Viewport.Height - player.Texture.Height);

            base.LoadContent();
        }