public MainMenuScreen(Game Game)
            : base(Game, GeneralManager.ScreenX, GeneralManager.ScreenY)
        {
            NewGameButton            = new Button(GeneralManager.GetPartialRect(0, 0.4f, 0.2f, 0.1f), " New Game ", GeneralManager.Textures["GUI/MainMenuGraphics/Button"], Color.Gray, Color.White, GeneralManager.Fonts["Fonts/28DaysLater"]);
            NewGameButton.Action     = NewGameButtonClick;
            NewGameButton.TextOffset = new Vector2(0, 10);

            LoadGameButton            = new Button(GeneralManager.GetPartialRect(0, 0.5f, 0.2f, 0.1f), " Load Game ", GeneralManager.Textures["GUI/MainMenuGraphics/Button"], Color.Gray, Color.White, GeneralManager.Fonts["Fonts/28DaysLater"]);
            LoadGameButton.Action     = NewGameButtonClick;
            LoadGameButton.TextOffset = new Vector2(0, 10);

            OptionsButton            = new Button(GeneralManager.GetPartialRect(0, 0.6f, 0.2f, 0.1f), "  Options  ", GeneralManager.Textures["GUI/MainMenuGraphics/Button"], Color.Gray, Color.White, GeneralManager.Fonts["Fonts/28DaysLater"]);
            OptionsButton.Action     = NewGameButtonClick;
            OptionsButton.TextOffset = new Vector2(0, 10);

            CreditsButton            = new Button(GeneralManager.GetPartialRect(0, 0.7f, 0.2f, 0.1f), "  Credits  ", GeneralManager.Textures["GUI/MainMenuGraphics/Button"], Color.Gray, Color.White, GeneralManager.Fonts["Fonts/28DaysLater"]);
            CreditsButton.Action     = NewGameButtonClick;
            CreditsButton.TextOffset = new Vector2(0, 10);

            ExitButton            = new Button(GeneralManager.GetPartialRect(0, 0.8f, 0.2f, 0.1f), "    Exit    ", GeneralManager.Textures["GUI/MainMenuGraphics/Button"], Color.Gray, Color.White, GeneralManager.Fonts["Fonts/28DaysLater"]);
            ExitButton.Action     = ExitGameButtonClick;
            ExitButton.TextOffset = new Vector2(0, 10);

            this.AddGUI(NewGameButton);
            this.AddGUI(LoadGameButton);
            this.AddGUI(OptionsButton);
            this.AddGUI(CreditsButton);
            this.AddGUI(ExitButton);

            BSS             = new BlackScreenSwitch();
            BSS.SwitchState = SceneSwitchEffect.State.SwitchOn;

            Renderer.AddPostProcess(BSS, "Switch");
            m = SoundEngine.PlayLooped("Content/Sounds/Ambient/menu_theme.mp3");
        }
Example #2
0
        public IntroScreen(Game Game)
            : base(Game, GeneralManager.ScreenX, GeneralManager.ScreenY)
        {
            BSS             = new BlackScreenSwitch();
            BSS.SwitchState = SceneSwitchEffect.State.SwitchOn;
            BSS.MaxTime     = 1f;
            m = SoundEngine.PlaySound(Vector2.Zero, "Content/Sounds/Logos jingle.mp3");

            Renderer.AddPostProcess(BSS, "Switch");
        }
Example #3
0
        public WorldScreen(Game Game)
            : base(Game, GeneralManager.ScreenX, GeneralManager.ScreenY)
        {
            GeneralManager.LoadAnimation("TestAnim", Vector2.One * 64, 6, 80);
            GeneralManager.LoadAnimation("PlayerIdle", Vector2.One * 64, 1, 10000);

            DebugWindow.Visible = false;
            DebugWindow.AddGUI(FarseerDebugCheck, DebugWindow);
            AddGUI(DebugWindow);

            LE = new LightingEngine();
            Color a = new Color(ambient, ambient, ambient);

            LE.SetAmbient(a, a);
            //LE.SetAmbient(Color.Gray, Color.Gray);
            Renderer.AddRendererEffect(LE, "LightingEngine");

            LoadContent();

            Map = new Map(this, tileSize, mapSize);
            //Renderer.AddPostProcess(new BlurEffect(), "Blur");
            SE               = new BlurSwitchEffect();
            SE.MaxTime       = 1f;
            SE.TurnOffAction = delegate() { Renderer.RemovePostProcess("Switch"); };
            Renderer.AddPostProcess(SE, "Switch");

            Camera.Init(GeneralManager.GetPartialRect(0, 0, 1, 1), new Rectangle(0, 0, tileSize * mapSize, tileSize * mapSize));

            PlayerLight = new SpotLight()
            {
                IsEnabled         = true,
                Color             = new Vector4(0.9f, .7f, .7f, 1f),
                Power             = .6f,
                LightDecay        = 600,
                Position          = new Vector3(500, 400, 20),
                SpotAngle         = 1.5f,
                SpotDecayExponent = 3,
                Direction         = new Vector3(0.244402379f, 0.969673932f, 0)
            };
            LE.AddLight(PlayerLight);

            Debug = new FarseerPhysics.DebugViews.DebugViewXNA(Map.PhysicalWorld);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.Shape);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.AABB);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.PerformanceGraph);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.Joint);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.ContactPoints);
            Debug.DefaultShapeColor  = Color.White;
            Debug.SleepingShapeColor = Color.LightGray;
            Debug.LoadContent(Parent.GraphicsDevice, Parent.Content);

            //Weapon w = new Weapon("test", "Gun", 100, 10, Hands.One, 10, 600, 10, 10, 10);
            //Serializer.Serialize<Weapon>("weapon.xml", w);
        }