Exemplo n.º 1
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.
            base.LoadContent();
            spriteBatch = new SpriteBatch(GraphicsDevice);
            TileMap.Initialize(
                Content.Load <Texture2D> (@"Textures/PlatformTiles"));
            //TileMap.spriteFont = Content.Load <SpriteFont> (@"font");

            //pericles8 = Content.Load <Microsoft.Xna.Framework.Graphics.SpriteFont> (@"font");
            titleScreen = Content.Load <Texture2D> (@"Textures/TitleScreen");

            Camera.WorldRectangle = new Rectangle(0, 0, 160 * TileMap.TileWidth, 12 * TileMap.TileHeight);
            Camera.Position       = Vector2.Zero;
            Camera.ViewPortWidth  = 800;
            Camera.ViewPortHeight = 600;
            player = new Player(Content);
            LevelManager.Initialize(Content, player);
        }
Exemplo n.º 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()
        {
            try{
                Assets.normal        = Content.Load <Song> (@"sounds/normal.wav");
                Assets.high          = Content.Load <Song> (@"sounds/High.wav");
                Assets.gettingHi     = Content.Load <Song> (@"sounds/gettinHi.wav");
                Assets.gettingNormal = Content.Load <Song> (@"sounds/gettingBack.wav");
                Assets.title         = Content.Load <Song> (@"sounds/titlescreen.wav");

                Assets.rip = Content.Load <Song> (@"sounds/dead.wav");
            }catch {
                Assets.normal        = Content.Load <Song> (@"sounds/normal");
                Assets.high          = Content.Load <Song> (@"sounds/High");
                Assets.gettingHi     = Content.Load <Song> (@"sounds/gettinHi");
                Assets.gettingNormal = Content.Load <Song> (@"sounds/gettingBack");
                Assets.title         = Content.Load <Song> (@"sounds/titlescreen");
                Assets.rip           = Content.Load <Song> (@"sounds/dead");
            }


            spriteBatch = new SpriteBatch(GraphicsDevice);
            TileMap.Initialize(Content.Load <Texture2D>(@"Textures\PlatformTiles"), 800, 480);
            try{
                pericles8 = Content.Load <SpriteFont>(@"Fonts\Pericles8");
            }catch {
                Assets.myFont = new BitFont(Content);
            }
            TileMap.spriteFont    = Assets.myFont;
            Assets.titleScreen    = Content.Load <Texture2D>(@"Textures\TitleScreen");
            Camera.WorldRectangle = new Rectangle(0, 0, TileMap.MapWidth * TileMap.TileSize, TileMap.MapHeight *
                                                  TileMap.TileSize);
            Camera.Position       = Vector2.Zero;
            Camera.ViewPortWidth  = 800;
            Camera.ViewPortHeight = 480;
            player = new Player(Content);
            LevelManager.Initialize(Content, player);

            screen = new TitleScreen();
            // TODO: use this.Content to load your game content here*/
        }