Ejemplo n.º 1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, null, null);

            FlowManager.Draw(gameTime);

            spriteBatch.End();

            base.Draw(gameTime);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            Bubble_Input.MouseHitUpdate();
            FlowManager.Update(gameTime);

            // if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            if (FlowManager.TimeToDie)
            {
                Exit();
            }

            // TODO: Add your update logic here

            base.Update(gameTime);
        }
Ejemplo n.º 3
0
        public void StartFlow()
        {
            if (FlowManager.CurrentFlow == "")
            {
                throw new Exception("Before you can start the flow sequence\nA flow must be loaded and activated");
            }
            switch (SBubble.RunMode)
            {
            case "CB":
                FlowManager.GoHardFlow(FlowCallBack.me);
                break;

            case "RF":
                FlowManager.GoHardFlow(FlowRepeat.me);
                break;

            default:
                throw new Exception($"Unknown runmode ({SBubble.RunMode})");
            }
        }
Ejemplo n.º 4
0
        static public void GoError(string ct, string message, string trace)
        {
            blocked = true;
            BubConsole.WriteLine($"ERROR>{message}", 255, 0, 0);
            Debug.WriteLine($"{ct}: {message}\nTraceback:\n{trace}\n\n");
            if (crashed)
            {
                return;
            }
            crashed = true;
            var s = QuickStream.OpenEmbedded("Death.png");

            if (s == null)
            {
                Debug.WriteLine("ERROR! Trying to read Death resulted into null!");
            }
            s.Position = 0;
            Death      = TQMG.GetImage(s);
            sct        = ct;
            smsg       = message;
            strace     = trace;
            FlowManager.GoHardFlow(new Error(), true);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            // TQMG
            TQMG.Init(graphics, GraphicsDevice, spriteBatch, SBubble.JCR);

            // Make sure all states consider at least these!
            SBubble.AddInit(delegate(string v) { SBubble.State(v).DoString($"function {FlowManager.NOTHING}() end", "Alright move along, nothing to see here!"); });
            SBubble.AddInit(BubbleConsole.StateInit);
            SBubble.AddInit(BubbleGraphics.InitGraphics);
            SBubble.AddInit(Bubble_Audio.Init);
            SBubble.AddInit(APIFlow.Init);
            SBubble.AddInit(BubbleSuperGlobal.Init);
            SBubble.AddInit(Bubble_Input.Init);
            SBubble.AddInit(Bubble_Save.Init);

            // Start init script
            FlowManager.StartInitFlow();


            // Error Test
            //Error.GoError("Test", "TestError", "Traceme");
        }