示例#1
0
        public void Render()
        {
            vergeGround.Draw();

            GameManager.DrawManager.Draw();

            BaseGame.BasicGraphics.DrawRectangle(mapRect, 3, Color.Red, 0f);
            BaseGame.BasicGraphics.DrawRectangleInScrn(scrnViewRect, 3, Color.Green, 0f);

            //foreach (Vector2 visiPoint in tank1.KeyPoints)
            //{
            //    BasicGraphics.DrawPoint( Vector2.Transform( visiPoint, tank1.TransMatrix ), 0.4f, Color.Blue, 0f );
            //}

            //foreach (Vector2 visiPoint in tank2.KeyPoints)
            //{
            //    BasicGraphics.DrawPoint( Vector2.Transform( visiPoint, tank2.TransMatrix ), 0.4f, Color.Blue, 0f );
            //}
        }
示例#2
0
        public void Render()
        {
            BaseGame.Device.Clear(Color.Blue);

            backGround.Draw();

            //BasicGraphics.DrawRectangle( wall.BoundingBox, 3f, Color.Red, 0f );

            //BasicGraphics.DrawRectangle( mapSize, 3f, Color.Red, 0f );
            foreach (Vector2 keyPoint in ball.KeyPoints)
            {
                BaseGame.BasicGraphics.DrawPoint(Vector2.Transform(keyPoint, ball.TransMatrix), 1f, Color.Black, 0f);
            }
            BaseGame.BasicGraphics.DrawPoint(Vector2.Transform(wall1.KeyPoints[0], wall1.TransMatrix), 1f, Color.Black, 0f);
            BaseGame.BasicGraphics.DrawPoint(Vector2.Transform(wall2.KeyPoints[0], wall2.TransMatrix), 1f, Color.Black, 0f);
            BaseGame.BasicGraphics.DrawPoint(Vector2.Transform(wall3.KeyPoints[0], wall3.TransMatrix), 1f, Color.Black, 0f);


            GameManager.DrawManager.Draw();
            compass.Draw();
        }
示例#3
0
        public void Render()
        {
            //simpleGround.Draw( camera.LogicViewRect );
            vergeGround.Draw();

            GameManager.DrawManager.Draw();

            BaseGame.BasicGraphics.DrawRectangle(mapSize, 3, Color.Red, 0f);
            BaseGame.BasicGraphics.DrawRectangleInScrn(scrnViewRect, 3, Color.Green, 0f);

            BaseGame.BasicGraphics.DrawPoint(BaseGame.CoordinMgr.LogicPos(ConvertHelper.PointToVector2(InputHandler.CurMousePos)), 3f, Color.Red, LayerDepth.Mouse);

            if (firstDraw)
            {
                //TextEffectMgr.AddRiseFade( "Use 'AWSD' to Move the Tank, 'JK' to Rotate the Turret,", new Vector2( 40, 150 ), 1.2f, Color.Red, LayerDepth.Text, FontType.Comic, 500, 0.2f );
                //TextEffectMgr.AddRiseFade( "and press Space To Shoot!", new Vector2( 40, 160 ), 1.2f, Color.Red, LayerDepth.Text, FontType.Comic, 500, 0.2f );

                firstDraw = false;
            }

            if (showFirstHit)
            {
                TextEffectMgr.AddRiseFade("哦,这个家伙变小了!", new Vector2(50, 70), 1.4f, Color.Red, LayerDepth.Text, GameFonts.HDZB, 300, 0.2f);
                showFirstHit = false;
            }

            if (showFirstScore)
            {
                TextEffectMgr.AddRiseFade("当这个物体消失时,你会获得100分!", new Vector2(20, 70), 1.4f, Color.Red, LayerDepth.Text, GameFonts.HDZB, 300, 0.2f);
                TextEffectMgr.AddRiseFade("不过这个物体也会开始运动。", new Vector2(20, 80), 1.4f, Color.Red, LayerDepth.Text, GameFonts.HDZB, 300, 0.2f);

                showFirstScore = false;
            }

            if (showFirstHitTank)
            {
                //TextEffect.AddRiseFade( "Oh, the Object hit you, it grows bigger!", new Vector2( 30, 150 ), 1.1f, Color.Red, LayerDepth.Text, FontType.Comic, 300, 0.2f );
                showFirstHitTank = false;
            }

            if (showNiceShoot)
            {
                if (NiceShootSum >= 30)
                {
                    TextEffectMgr.AddRiseFade("GOD LIKE!", tank.Pos, 1.1f, Color.Black, LayerDepth.Text, GameFonts.Comic, 200, 1f);
                }
                else if (NiceShootSum >= 17)
                {
                    TextEffectMgr.AddRiseFade("Master Shoot!", tank.Pos, 1.1f, Color.Pink, LayerDepth.Text, GameFonts.Comic, 200, 1f);
                }
                else if (NiceShootSum >= 4)
                {
                    TextEffectMgr.AddRiseFade("Nice Shoot!", tank.Pos, 1.1f, Color.GreenYellow, LayerDepth.Text, GameFonts.Comic, 200, 1f);
                }

                showNiceShoot = false;
            }

            if (tank.Rader.PointInRader(InputHandler.GetCurMousePosInLogic(BaseGame.RenderEngine)))
            {
                BaseGame.FontMgr.DrawInScrnCoord("mouse In Rader!", ConvertHelper.PointToVector2(InputHandler.CurMousePos), 0.6f, Color.Yellow, LayerDepth.Text, GameFonts.Lucida);
            }

            if (tank.Rader.ShelterObjs.Length != 0)
            {
                foreach (IShelterObj obj in tank.Rader.ShelterObjs)
                {
                    BaseGame.FontMgr.Draw("I am Sheltered by " + (obj as IGameObj).Name + " Pos: " + ((IGameObj)obj).Pos.ToString(), tank.Pos, 0.6f, Color.Yellow, LayerDepth.Text, GameFonts.Lucida);
                }
            }


            BaseGame.FontMgr.DrawInScrnCoord("You Score : " + Score.ToString(), new Vector2(500, 40), 0.6f, Color.Yellow, LayerDepth.Text, GameFonts.Comic);
            BaseGame.FontMgr.DrawInScrnCoord("Shoot Sum : " + shootSum.ToString(), new Vector2(500, 60), 0.6f, Color.Yellow, LayerDepth.Text, GameFonts.Comic);
            BaseGame.FontMgr.DrawInScrnCoord("hit Sum   : " + hitSum.ToString(), new Vector2(500, 80), 0.6f, Color.Yellow, LayerDepth.Text, GameFonts.Comic);
            float hitRate = shootSum != 0 ? (float)hitSum * 100 / (float)shootSum : 0;

            BaseGame.FontMgr.DrawInScrnCoord("hit rate  : " + hitRate.ToString() + "%", new Vector2(500, 100), 0.6f, Color.Yellow, LayerDepth.Text, GameFonts.Comic);
        }