Beispiel #1
0
        //protected override void Draw(GameTime gameTime)
        //{
        //    //if (OnlineState.AskingRole == state || OnlineState.Connecting == state)
        //    //    Tools.DrawSingle(startScreen);
        //    //else
        //    //{
        //        //startScreen.kill();
        //        GraphicsDevice.Clear(Color.CornflowerBlue);

        //        if (state == OnlineState.Playing)
        //        {
        //            Tools.sb.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend,
        //            null, null, null, null, Global.me.cam.Mat);
        //            Event_Draw?.Invoke();//draw hapend
        //            Tools.sb.End();
        //            base.Draw(gameTime);
        //        }
        //    //}
        //    base.Draw(gameTime);
        //}
        #endregion

        protected override void Draw(GameTime gameTime)
        {
            if (!Global.gamseStarted)
            {
                Tools.DrawSingle(startScreen);
                if (Tools.ks.IsKeyDown(Keys.S))
                {
                    Global.gamseStarted = true;
                    startScreen.kill();
                }

                return;
            }

            if (Global.gameEnd != true)
            {
                GraphicsDevice.Clear(Color.CornflowerBlue);
                DrawViewport(rightVp, Cme.Mat);
                DrawViewport(leftVp, Cenemy.Mat);
            }
            else
            {
                Global.nxtlevel();
                //GraphicsDevice.Viewport = new Viewport(0, 0, Tools.W, Tools.H);
            }

            base.Draw(gameTime);
        }