예제 #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()
        {
            Settings    = new GameSettings(this);
            SpriteBatch = new SpriteBatch(GraphicsDevice);
            Sounds.LoadContent();
            Pixel = new Texture2D(GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
            Pixel.SetData(new[] { Color.White });

            MouseInput    = new MouseInput();
            TouchInput    = new TouchInput();
            UnifiedInput  = new UnifiedInput(this);
            KeyboardInput = new KeyboardInput(this);
            UnifiedInput.TapListeners.Add(t => Arena?.OnTap(t));

            Levels.Levels.LoadContent(Content);
            Fonts.LoadContent(Content);
            Textures.LoadContent(Content);
            Sprites.LoadContent(this, Content);
            Starfield  = new Starfield(100, ArenaArea);
            PauseArena = new PauseArena(this);
            Arena      = new MenuArena(this);
            Arena.Initialise();
        }
예제 #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);
            Pixel       = new Texture2D(GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
            Pixel.SetData(new[] { Color.White });
            Logo    = new TitleLogo(this);
            SideBar = new SideBar(this);

            MouseInput    = new MouseInput();
            TouchInput    = new TouchInput();
            UnifiedInput  = new UnifiedInput(this);
            KeyboardInput = new KeyboardInput(this);
            UnifiedInput.TapListeners.Add(t => Arena?.OnTap(t));

            Textures.LoadContent(Content);
            Sprites.LoadContent(this, Content);
            Fonts.LoadContent(Content);
            Sounds = new Sounds(this);

            TileSet01 = new TileSet(Strings.Park, new Color(37f / 255f, 92f / 255f, 64f / 255f), Textures.TileSetJungle01, Textures.TileSetShadows, Textures.TileSetBridges);
            TileSet02 = new TileSet(Strings.Jungle, new Color(13f / 255f, 69f / 255f, 17f / 255f), Textures.TileSetJungle02, Textures.TileSetShadows, Textures.TileSetBridges);
            TileSet03 = new TileSet(Strings.RoadBlock, new Color(101f / 255f, 97f / 255f, 96f / 255f), Textures.TileSetRoad01, Textures.TileSetShadows, Textures.TileSetBridgesRoad);
            TileSet04 = new TileSet(Strings.Geiger, new Color(39f / 255f, 37f / 255f, 92f / 255f), Textures.TileSetGeiger01, Textures.TileSetShadows, Textures.TileSetBridgesGeiger);


            TileSets = new TileSet[] { TileSet01, TileSet02, TileSet03, TileSet04 };
            TileSet  = TileSets[GameSettings.TileSet];

            MenuMap.Initialize();

            MenuArena  = new MenuArena(this);
            PauseArena = new PauseArena(this, MenuArena);

            _arena = MenuArena;
            _arena.Initialise();
        }