Example #1
0
        protected override void Draw()
        {
            if (Intelperceptual == null&&intelperceptual.error!=1)
            Intelperceptual = new intelperceptual();
           // base.GraphicsDevice.Clear(Color.CornflowerBlue);
            if (Settings.or != 1)
            {
                Assets.focusStatee(false);
                spriteBatch.Begin();
                spriteBatch.Draw(Assets.wrn.tex, new Rectangle(0, 0, (int)Program.game.Width, (int)Program.game.Height), Color.White);
                spriteBatch.End();
                return;

            }
             
            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, (((( this.camera.ViewMatrix * Matrix.CreateScale(1f, -1f, 0f)) * Matrix.CreateTranslation(0f, Assets.screenHeight, 0f)) * Matrix.CreateScale((float)(Assets.screenHeight / 500f))) * Matrix.CreateTranslation(Assets.screenWidth / 3.2f, -Assets.screenHeight / 1.8f, 0f)) * Matrix.CreateScale(((float)Program.game.Width) / Assets.screenWidth, ((float)Program.game.Height) / Assets.screenHeight, 0f));
             gamescreen.present(0.018f);
            spriteBatch.End();
            spriteBatch1.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, this.camera.ViewMatrix * Matrix.CreateScale(((float)Program.game.Width) / Assets.screenWidth, ((float)Program.game.Height) / Assets.screenHeight, 0f));
            spriteBatch1.Draw(Assets.side.tex, new Vector2(-Assets.screenWidth / 6.95f, 0f), Color.White);
            spriteBatch1.Draw(Assets.side.tex, new Vector2(Assets.screenWidth / 1.445f, 0f), Color.White);
            if (Assets.loaderp != 100)
            {
                spriteBatch1.Draw(Assets.splashscreen.tex, new Rectangle(0, 0, (int)Assets.screenWidth, (int)Assets.screenHeight), new Rectangle?(Assets.loadscreen.rectangle), Color.White);
            }
            spriteBatch1.End();
            if (Assets.loaderp == 100)
            {
                
                

                //Matrix m = (((this.camera.ViewMatrix * Matrix.CreateScale(1f, -1f, 0f)) * Matrix.CreateTranslation(0f, Assets.screenHeight, 0f)));
                //spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, m);
                //engine.textDraw(290f, 400f, 2f, 1f, 0, evd.ToString(), 1f, 1f, 0.3f, 1f, " ");
                //engine.textDraw(100f, 400f, 2f, 1f, 0, evd1.ToString(), 1f, 1f, 0.3f, 1f, " ");
                //spriteBatch.End();


                if(Game.gd.Gamestate==0)
               
                {spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, ((((this.camera.ViewMatrix * Matrix.CreateScale(1f, -1f, 0f)) * Matrix.CreateTranslation(0f, Assets.screenHeight, 0f)) * Matrix.CreateScale((float)(Assets.screenHeight / 500f))) * Matrix.CreateTranslation(Assets.screenWidth / 3.2f, -Assets.screenHeight / 1.8f, 0f)) * Matrix.CreateScale(((float)Program.game.Width) / Assets.screenWidth, ((float)Program.game.Height) / Assets.screenHeight, 0f));
                engine.textDraw(10f-90, 460f, 2f, 1f, 1, "Score", 1f, 1f, .4f, 1f, " ");
                Game.drawnumber((int)Game.gd.score, 80-90, 430, 15);
                engine.textDraw(10f - 90, 400f, 2f, 1f, 1, "Life", 1f, 1f, .4f, 1f, " ");
                Game.drawnumber((int)Game.gd.life, 50 - 90, 380, 15);
                engine.textDraw(200f+130, 460f, 2f, 1f, 1, "Battery", 1f, 1f, .3f, 1f, " ");
                Game.drawnumber(Game.gd.coins, (Game.gd.score > 999 ? 390 : 410), 430, 15);
                engine.setcolor(.8f, .8f, .8f, .8f);
                engine.textDraw(290f+50, 400f, 2f, 1f, 0, "II", 1f, 1f, .3f, 1f, " ");
                engine.setcolor(1f, 1f, 1f, 1f);
                spriteBatch.End();
                }




                spriteBatch.Begin();
                spriteBatch.Draw(Assets.textureregions[68].texhold.tex, new Vector2(Game.gd.pointx1, Game.gd.pointy1), Assets.textureregions[68].rectangle, Color.White, 90 * 80, new Vector2(50, 50), .4f, SpriteEffects.None, 0);
               // gamescreen.batcher.drawSprite(Game.gd.pointx, Game.gd.pointy, 20f, 20f, 30f, Assets.textureregions[0x44]);
                if(camerapre!=null)
                spriteBatch.Draw(camerapre,new Rectangle(80,360,320,240),Color.White);

                if (camerapre1 != null)
                spriteBatch.Draw(camerapre1,new Rectangle(80,600,320,240), Color.White);

                //if (camerapre2 != null)
               // spriteBatch.Draw(camerapre2, new Vector2(400, 100), Color.White);
                if (intelperceptual.device_lost)
                    Velocity.DebugBox.Text = "Camera disconnected";
                 ////   engine.textDraw(10f , 460f, 2f, 1f, 1, "Camera disconnected", 1f, 1f, .4f, 1f, " ");
                else
                    Velocity.DebugBox.Text = "" + Game.gd.pointx1 + "   " + Game.gd.pointy1;
                if(camerapre==null&&intelperceptual.error!=1)
                    Velocity.DebugBox.Text = "Wait Camera intialising";

                if (intelperceptual.error == 1)
                {
                    Velocity.DebugBox.Size = new System.Drawing.Size(350, 50);
                    Velocity.DebugBox.Text = "Sorry Error in  Camera intialising press esc thrice to quit";
                }
                evd = (int)Game.gd.pointx;
                evd1 = (int)Game.gd.pointy;
                spriteBatch.End();






            }
            this.inputUpdate();


            this.Invalidate();
        }
Example #2
0
        protected override void Draw()
        {
            if (Intelperceptual == null && intelperceptual.error != 1)
            {
                Intelperceptual = new intelperceptual();
            }
            // base.GraphicsDevice.Clear(Color.CornflowerBlue);
            if (Settings.or != 1)
            {
                Assets.focusStatee(false);
                spriteBatch.Begin();
                spriteBatch.Draw(Assets.wrn.tex, new Rectangle(0, 0, (int)Program.game.Width, (int)Program.game.Height), Color.White);
                spriteBatch.End();
                return;
            }

            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, ((((this.camera.ViewMatrix * Matrix.CreateScale(1f, -1f, 0f)) * Matrix.CreateTranslation(0f, Assets.screenHeight, 0f)) * Matrix.CreateScale((float)(Assets.screenHeight / 500f))) * Matrix.CreateTranslation(Assets.screenWidth / 3.2f, -Assets.screenHeight / 1.8f, 0f)) * Matrix.CreateScale(((float)Program.game.Width) / Assets.screenWidth, ((float)Program.game.Height) / Assets.screenHeight, 0f));
            gamescreen.present(0.018f);
            spriteBatch.End();
            spriteBatch1.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, this.camera.ViewMatrix * Matrix.CreateScale(((float)Program.game.Width) / Assets.screenWidth, ((float)Program.game.Height) / Assets.screenHeight, 0f));
            spriteBatch1.Draw(Assets.side.tex, new Vector2(-Assets.screenWidth / 6.95f, 0f), Color.White);
            spriteBatch1.Draw(Assets.side.tex, new Vector2(Assets.screenWidth / 1.445f, 0f), Color.White);
            if (Assets.loaderp != 100)
            {
                spriteBatch1.Draw(Assets.splashscreen.tex, new Rectangle(0, 0, (int)Assets.screenWidth, (int)Assets.screenHeight), new Rectangle?(Assets.loadscreen.rectangle), Color.White);
            }
            spriteBatch1.End();
            if (Assets.loaderp == 100)
            {
                //Matrix m = (((this.camera.ViewMatrix * Matrix.CreateScale(1f, -1f, 0f)) * Matrix.CreateTranslation(0f, Assets.screenHeight, 0f)));
                //spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, m);
                //engine.textDraw(290f, 400f, 2f, 1f, 0, evd.ToString(), 1f, 1f, 0.3f, 1f, " ");
                //engine.textDraw(100f, 400f, 2f, 1f, 0, evd1.ToString(), 1f, 1f, 0.3f, 1f, " ");
                //spriteBatch.End();


                if (Game.gd.Gamestate == 0)

                {
                    spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, ((((this.camera.ViewMatrix * Matrix.CreateScale(1f, -1f, 0f)) * Matrix.CreateTranslation(0f, Assets.screenHeight, 0f)) * Matrix.CreateScale((float)(Assets.screenHeight / 500f))) * Matrix.CreateTranslation(Assets.screenWidth / 3.2f, -Assets.screenHeight / 1.8f, 0f)) * Matrix.CreateScale(((float)Program.game.Width) / Assets.screenWidth, ((float)Program.game.Height) / Assets.screenHeight, 0f));
                    engine.textDraw(10f - 90, 460f, 2f, 1f, 1, "Score", 1f, 1f, .4f, 1f, " ");
                    Game.drawnumber((int)Game.gd.score, 80 - 90, 430, 15);
                    engine.textDraw(10f - 90, 400f, 2f, 1f, 1, "Life", 1f, 1f, .4f, 1f, " ");
                    Game.drawnumber((int)Game.gd.life, 50 - 90, 380, 15);
                    engine.textDraw(200f + 130, 460f, 2f, 1f, 1, "Battery", 1f, 1f, .3f, 1f, " ");
                    Game.drawnumber(Game.gd.coins, (Game.gd.score > 999 ? 390 : 410), 430, 15);
                    engine.setcolor(.8f, .8f, .8f, .8f);
                    engine.textDraw(290f + 50, 400f, 2f, 1f, 0, "II", 1f, 1f, .3f, 1f, " ");
                    engine.setcolor(1f, 1f, 1f, 1f);
                    spriteBatch.End();
                }



                spriteBatch.Begin();
                spriteBatch.Draw(Assets.textureregions[68].texhold.tex, new Vector2(Game.gd.pointx1, Game.gd.pointy1), Assets.textureregions[68].rectangle, Color.White, 90 * 80, new Vector2(50, 50), .4f, SpriteEffects.None, 0);
                // gamescreen.batcher.drawSprite(Game.gd.pointx, Game.gd.pointy, 20f, 20f, 30f, Assets.textureregions[0x44]);
                if (camerapre != null)
                {
                    spriteBatch.Draw(camerapre, new Rectangle(80, 360, 320, 240), Color.White);
                }

                if (camerapre1 != null)
                {
                    spriteBatch.Draw(camerapre1, new Rectangle(80, 600, 320, 240), Color.White);
                }

                //if (camerapre2 != null)
                // spriteBatch.Draw(camerapre2, new Vector2(400, 100), Color.White);
                if (intelperceptual.device_lost)
                {
                    Velocity.DebugBox.Text = "Camera disconnected";
                }
                ////   engine.textDraw(10f , 460f, 2f, 1f, 1, "Camera disconnected", 1f, 1f, .4f, 1f, " ");
                else
                {
                    Velocity.DebugBox.Text = "" + Game.gd.pointx1 + "   " + Game.gd.pointy1;
                }
                if (camerapre == null && intelperceptual.error != 1)
                {
                    Velocity.DebugBox.Text = "Wait Camera intialising";
                }

                if (intelperceptual.error == 1)
                {
                    Velocity.DebugBox.Size = new System.Drawing.Size(350, 50);
                    Velocity.DebugBox.Text = "Sorry Error in  Camera intialising press esc thrice to quit";
                }
                evd  = (int)Game.gd.pointx;
                evd1 = (int)Game.gd.pointy;
                spriteBatch.End();
            }
            this.inputUpdate();


            this.Invalidate();
        }