Esempio n. 1
0
        public override void LoadContent(ContentManager Content)
        {
            base.LoadContent(Content);

            font = new UI.GameFont(Rect, Rect.Width);
            font.LoadContent(Content, UI.FontColor.Yellow);
        }
Esempio n. 2
0
        public override void LoadContent(ContentManager Content)
        {
            Graphics.Textures.LoadContent(Content);

            base.LoadContent(Content);
            Engine.Paused = false;
            APEngine.SoundManager.SoundManager.LoadContent(Content);
            SoundManager = new APEngine.SoundManager.SoundManager();
            SoundManager.Volume = GameSettings.SFXVol;
            GossipManager = new Entities.Gossip.GossipManager();
            EditorMode = false;

            paused = Content.Load<Texture2D>("Data\\GFX\\Paused");
            Congrats = Content.Load<Texture2D>("Data\\GFX\\Congratz");
            lifeCounter = Content.Load<Texture2D>("Data\\GFX\\LivesIcon");
            ammoCounter = Content.Load<Texture2D>("Data\\GFX\\AmmoIcon");
            starPowerCounter = Content.Load<Texture2D>("Data\\GFX\\StarPowerBar");

            level = new Map.Level();
            level.CheckpointReached = false;

            EditUI = new Map.Editor.EditorUI(UIScale);
            EditUI.LoadContent(Content);

            lifeCountTimer = new UITimer(6000f);
            ammoTimer = new UITimer(6000f);
            starPowerTimer = new UITimer(6000f);
            uiBackgroundTimer = new UITimer(6500f);
            uiBackgroundPos = new Vector2(0, 0);

            projectiles = new List<Entities.Projectile>();
            entities = new List<Entities.Entity>();
            gameObjects = new List<GameObjects.GameObject>();
            mapGameObjects = new List<GameObjects.GameObject>();
            waterObjects = new List<GameObjects.Water>();
            clouds = new List<Map.Cloud>();

            powerUpsWindow = new UI.InfoBox(new Rectangle((int)(Engine.Monitor.VirtualWidth / 2) - 200, (int)(Engine.Monitor.VirtualHeight / 2) - 100, 400, 200));
            powerUpsWindow.LoadContent(Content);
            powerUpsWindow.Visible = false;

            projectiles.Clear();
            entities.Clear();
            gameObjects.Clear();

            backgroundFront = Content.Load<Texture2D>("Data\\GFX\\Forest\\backgroundFront");
            backgroundSky = Content.Load<Texture2D>("Data\\GFX\\Forest\\backgroundSkyNight");
            uiBackgroundTexture = Content.Load<Texture2D>("Data\\GFX\\UIBackground");

            FillClouds(10, Map.CloudType.Dark);

            Entities.Player player = new Entities.Player(level.PlayerSpawn, 1);
            player.Ability.HasDoubleJump = true;
            AddEntity(player);

            camera.LevelHeight = level.Height * Map.Tile.HEIGHT;
            camera.LevelWidth = level.Width * Map.Tile.WIDTH;

            healthText = Content.Load<Texture2D>("Data\\GFX\\healthText");
            healthBar = Content.Load<Texture2D>("Data\\GFX\\healthBar");

            textBox = new UI.GameFont(new Rectangle(100, Engine.Monitor.Height - 20, 800, 20), 800f);
            textBox.LoadContent(Content);
            textBox.Text = "Twitch: www.twitch.tv/corpseloleu | Twitter: @corpsegrindr";

            lifePos = new Vector2(10, 10);
            ammoPos = new Vector2(10, 15 + lifeCounter.Height * UIScale);
            starPowerPos = new Vector2(Engine.Monitor.VirtualWidth - 80 * UIScale, 12);

            lives = new UI.GameFont(new Rectangle((int)(lifePos.X + lifeCounter.Width * UIScale), (int)(lifePos.Y + 12 * UIScale), 200, 18), 200);
            lives.LoadContent(Content);
            lives.Text = player.Lives.ToString();

            ammo = new UI.GameFont(new Rectangle((int)(ammoPos.X + ammoCounter.Width * UIScale), (int)(ammoPos.Y + 8 * UIScale), 200, 18), 200);
            ammo.LoadContent(Content);
            ammo.Text = player.Clip.ToString();

            starPowerFont = new UI.GameFont(new Rectangle((int)(starPowerPos.X + starPowerCounter.Width * UIScale), (int)(starPowerPos.Y + 10 * UIScale), 100, 18), 100);
            starPowerFont.LoadContent(Content);
            starPowerFont.Text = player.Lives.ToString();

            AddGameObject(new GameObjects.DoubleJump(new Vector2(level.PlayerSpawn.X + 32 * 25, level.PlayerSpawn.Y + 16 - (32 * 5))));

            //level.CreateNewLevel(Map.Theme.JungleForest, 40, 40, "Empty Level");
            level.LoadMap("Empty Level");
        }
Esempio n. 3
0
        public override void LoadContent(ContentManager Content)
        {
            base.LoadContent(Content);

            menuBackground = Content.Load<Texture2D>("Data\\GFX\\MainMenuBackground");
            menuBack = Content.Load<Texture2D>("Data\\GFX\\MenuBack");
            menuBackSelect = Content.Load<Texture2D>("Data\\GFX\\MenuBackSelected");
            menuApply = Content.Load<Texture2D>("Data\\GFX\\MenuApply");
            menuApplySelect = Content.Load<Texture2D>("Data\\GFX\\MenuApplySelected");
            menuSFX = Content.Load<Texture2D>("Data\\GFX\\MenuSFXVolume");
            menuSFXSelect = Content.Load<Texture2D>("Data\\GFX\\MenuSFXVolumeSelected");
            menuMusic = Content.Load<Texture2D>("Data\\GFX\\MenuMusicVolume");
            menuMusicSelect = Content.Load<Texture2D>("Data\\GFX\\MenuMusicVolumeSelected");
            menuResolution = Content.Load<Texture2D>("Data\\GFX\\MenuResolution");
            menuResolutionSelect = Content.Load<Texture2D>("Data\\GFX\\MenuResolutionSelected");
            menuFullscreen = Content.Load<Texture2D>("Data\\GFX\\MenuFullscreen");
            menuFullscreenSelect = Content.Load<Texture2D>("Data\\GFX\\MenuFullscreenSelected");

            aButton = Content.Load<Texture2D>("Data\\GFX\\AButtonIcon");
            bButton = Content.Load<Texture2D>("Data\\GFX\\BButtonIcon");
            xButton = Content.Load<Texture2D>("Data\\GFX\\XButtonIcon");
            yButton = Content.Load<Texture2D>("Data\\GFX\\YButtonIcon");

            menuSelectHeight = menuBack.Height;

            SoundManager.SoundManager.LoadContent(Content);
            soundManager = new SoundManager.SoundManager();

            MenuPos = new Vector2(Engine.Monitor.VirtualWidth - (int)(menuBack.Width * 1.5f), 120);

            fontSFX = new UI.GameFont(new Rectangle((int)MenuPos.X + 9, (int)MenuPos.Y + menuSelectHeight + 10, 256, 20), 256);
            fontSFX.LoadContent(Content);
            soundManager.Volume = GameSettings.SFXVol;
            fontSFX.Text = Math.Round((soundManager.Volume * 100f), 0).ToString() + "%";

            fontMusic = new UI.GameFont(new Rectangle((int)MenuPos.X + 9, (int)MenuPos.Y + (menuSelectHeight * 3) + 10, 256, 20), 256);
            fontMusic.LoadContent(Content);
            SoundManager.MusicManager.Volume = GameSettings.MusicVol;
            fontMusic.Text = Math.Round((SoundManager.MusicManager.Volume * 100f), 0).ToString() + "%";

            FillRes();

            fontRes = new UI.GameFont(new Rectangle((int)MenuPos.X + 9, (int)MenuPos.Y + (menuSelectHeight * 5) + 10, 256, 20), 300);
            fontRes.LoadContent(Content);
            fontRes.Text = GetResolution(selRes);

            fontFullscreen = new UI.GameFont(new Rectangle((int)MenuPos.X + 9, (int)MenuPos.Y + (menuSelectHeight * 7) + 10, 256, 20), 300);
            fontFullscreen.LoadContent(Content);
            fontFullscreen.Text = fullScreen.ToString().ToUpper();

            fontInfo = new UI.GameFont(new Rectangle(10, 100, 300, 20), 300);
            fontInfo.LoadContent(Content);
            fontInfo.Text = INFORMATION_TEXT;

            fontInfo2 = new UI.GameFont(new Rectangle(160, 151, 300, 20), 300);
            fontInfo2.LoadContent(Content, UI.FontColor.Yellow);
            fontInfo2.Text = INFORMATION_TEXT_KEYS;

            selRes = GameSettings.GetSelectedResolutionFromResolution(Engine.Monitor.Width, Engine.Monitor.Height);
            fullScreen = false;

            if (GameSettings.Fullscreen == 1)
                fullScreen = true;
        }