Пример #1
0
        protected override void LoadContent()
        {
            skyBox.Load(this.Content, "Textures\\SkyBoxes\\BlueSky\\SkyEffect", "Textures\\SkyBoxes\\BlueSky\\SkyBoxTex");
            font = Content.Load <SpriteFont>("Fonts\\gameFont");

            sexyTexture = Content.Load <Texture2D>("Textures\\lolbar");
            staminaTex  = Content.Load <Texture2D>("Textures\\yellowGradient");
            healthTex   = Content.Load <Texture2D>("Textures\\greenGradient");
            backBar     = Content.Load <Texture2D>("Textures\\rock");
            infinity    = Content.Load <Texture2D>("Textures\\infinity");

            LoadCharacterModels();
            if (NetworkManager == null || networkManager.GetType().Equals(typeof(ServerNetworkManager)))
            {
                LoadMap();
            }


            if (NetworkManager != null)
            {
                this.NetworkManager.Connect();
            }

            gameManager.Init(this);

            soundManager.StartBackgroundMusic();
        }
Пример #2
0
        public PKGame(GameConfiguration gameConfiguration)
        {
            this.gameConfiguration = gameConfiguration;

            graphics = new GraphicsDeviceManager(this);

            TargetElapsedTime = TimeSpan.FromTicks(333333);

            Content.RootDirectory = "Content";

            graphics.PreferredBackBufferWidth  = gameConfiguration.ResolutionWidth;
            graphics.PreferredBackBufferHeight = gameConfiguration.ResolutionHeigth;
            graphics.IsFullScreen        = gameConfiguration.IsFullScreen;
            graphics.PreferMultiSampling = false;

            this.gameManager = gameConfiguration.GameManager;

            this.networkManager = gameConfiguration.NetworkManager;

            if (this.networkManager != null)
            {
                if (networkManager.GetType().Equals(typeof(ServerNetworkManager)))
                {
                    AssestsAreReady = true;
                }
                else
                {
                    AssestsAreReady = false;
                }
            }
            else
            {
                AssestsAreReady = true;
            }
        }