Ejemplo n.º 1
0
 public void Update()
 {
     string[] signalParams = menuFactory.signal.Split(',');
     if (signalParams[0] == "reload")
     {
         Reload();
         menuFactory.signal = "";
     }
     if (signalParams[0] == "change state")
     {
         state.TransitionState(signalParams[1]);
     }
     if (state.currentState == "main menu")
     {
         menuFactory.Update();
     }
     else if (state.currentState == "editor")
     {
         mapEditor.Update();
         if (mapEditor.signal == "exit")
         {
             state.JumpToState("main menu");
             menuFactory.signal = "";
             mapEditor          = new editor.MapEditor(this.graphics);
         }
     }
     else if (state.currentState == "demo")
     {
         collisionDemo.Update();
     }
 }
Ejemplo n.º 2
0
        public void LoadGL()
        {
            GL.Enable(EnableCap.Blend);
            GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
            GL.ClearColor(0.0f, 0.0f, 0.0f, 1.0f);

            graphics      = new gfx.Graphics(new prim.Size(width, height), mainConfig);
            mapEditor     = new editor.MapEditor(graphics);
            menuFactory   = new ui.MenuFactory(graphics);
            collisionDemo = new demo.CollisionDemo(graphics);
            menuFactory.GotoMenu("main menu");

            graphics.size.w = this.width;
            graphics.size.h = this.height;
        }