示例#1
0
        public void Draw(DrawHelper draw)
        {
            draw.DrawSprite(GetDrawMatrix(), shipTexture, new Vector2(-0.02f, -0.02f), new Vector2(0.02f, 0.02f));
            draw.DrawLine(GetVectorMatrix(new Vector2((float) Math.Cos(turretAngle), (float) Math.Sin(turretAngle)))
                             * GetTranslationMatrix() * draw.ortho
                         , new Vector2(), new Vector2(0.0f, 0.04f), Color.LightPink);

            foreach (Bullet b in bullets) {
                b.Draw(draw);
            }
        }
示例#2
0
文件: Game1.cs 项目: luqui/luqui-misc
        protected override void LoadContent()
        {
            effect = Content.Load<Effect>("Effects");
            draw = new DrawHelper(graphics, effect);

            metric = new Metric(new SphereFundamentalPoly(), Tweaks.METRIC_RESX, Tweaks.METRIC_RESY);

            player = new PlayerShip(PlayerIndex.One, metric, new Vector2(0.5f, 0.5f));
            enemies = new LinkedList<Enemy>();

            renderTarget = new RenderTarget2D(graphics.GraphicsDevice, Tweaks.SOURCE_RESX, Tweaks.SOURCE_RESY, 0, SurfaceFormat.Color);
            double theta = 0.5 * Math.PI;
            metric.modifyCircle(new Metric.TangentSpace(0.4f*(float)Math.Cos(theta), -0.4f*(float)Math.Sin(theta), 0.4f*(float)Math.Sin(theta), 0.4f*(float)Math.Cos(theta)), new Vector2(0.5f, 0.5f), 0.2f);
            //metric.modifyCircle(new Metric.TangentSpace(-1.0f, 0.0f, 0.0f, -1.0f), new Vector2(0.9f, 0.9f), 0.5f);
            ReloadDistortionMap();

            {
                Color color = Color.DarkGreen;
                grid = new VertexPositionColor[64];
                int idx = 0;
                for (float x = 0; x < 1 && idx < 64; x += 1.0f/16.0f) {
                    grid[idx++] = new VertexPositionColor(new Vector3(x, 0, 0), color);
                    grid[idx++] = new VertexPositionColor(new Vector3(x, 1, 0), color);
                    grid[idx++] = new VertexPositionColor(new Vector3(0, x, 0), color);
                    grid[idx++] = new VertexPositionColor(new Vector3(1, x, 0), color);
                }
            }
        }
示例#3
0
文件: Enemy.cs 项目: luqui/luqui-misc
 public abstract void Draw(DrawHelper draw);
示例#4
0
 public override void Draw(DrawHelper draw)
 {
     draw.DrawSprite(GetDrawMatrix(), enemyTexture, new Vector2(-0.02f, -0.02f), new Vector2(0.02f, 0.02f));
 }
示例#5
0
 public void Draw(DrawHelper draw)
 {
     draw.DrawSprite(GetDrawMatrix(), bulletTexture, new Vector2(-0.005f, -0.005f), new Vector2(0.005f, 0.005f));
 }