Example #1
0
 public EndScene()
     : base("end")
 {
     BackgroundColor = Program.Foreground;
     var logo = new LogoElement(Interface, Interface.Size / 2f);
     logo.Texture = Program.EndScreen;
     logo.Color = Program.Foreground;
 }
Example #2
0
        public MainScene()
            : base("Unconventional")
        {
            BackgroundColor = Program.Background;
            Camera.LocalCoord = Engine.Resolution / 2f;

            if (!GameStarted)
            {
                var logo = new LogoElement(Interface, Interface.Size / 2f + new Vector2(0f, 32f));
                var menu = new MenuElement(Interface, new Cog.Vector2(0f, Interface.Size.Y / 2f + logo.Size.Y + 8f), Program.Font16);
                var info = new TextElement(Interface, new Cog.Vector2(Interface.Size.X / 2f, Interface.Size.Y - 8f), Program.Font12,
                    "A game made in 48 hours for Ludum Dare 32 and LBS Game Awards 2015", Cog.Modules.Renderer.HAlign.Center, Cog.Modules.Renderer.VAlign.Bottom);

                InterfaceElements.Add(logo);
                InterfaceElements.Add(menu);
                InterfaceElements.Add(info);

                menu.AddOption("Start Game", () =>
                {
                    GameStarted = true;
                });
                menu.AddOption("Quit", () =>
                {
                    Engine.SceneHost.Pop();
                });
            }

            World = CreateObject<World>(Vector2.Zero);

            if (!GameStarted)
            {
                Camera.WorldCoord += new Vector2(328f, 0f);
                startMove = Camera.WorldCoord;
            }

            if (World.LevelNum > 0)
            {
                moveProgress = -1f;
            }

            RegisterEvent<UpdateEvent>(0, Update);
        }