Exemple #1
0
 public PlayerShip(PlayerIndex inplayer, Metric metric, Vector2 pos)
     : base(pos, new Vector2(0.01f, 0.0f), metric)
 {
     shipTexture = Tweaks.CONTENT.Load<Texture2D>("playerShip");
     player = inplayer;
     bullets = new LinkedList<Bullet>();
     turretAngle = 0.0f;
     fireCooldown = 0.0f;
 }
Exemple #2
0
 protected SpatialObject(Vector2 pos, Vector2 vel, Metric met)
 {
     metric = met;
     position = pos;
     velocity = vel;
 }
Exemple #3
0
        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);
                }
            }
        }
 public RandomMotionEnemy(Metric metric, Vector2 pos)
     : base(metric, pos)
 {
     enemyTexture = Tweaks.CONTENT.Load<Texture2D>("zetaEnemy");
 }
Exemple #5
0
 public Enemy(Metric metric, Vector2 pos)
     : base(pos, new Vector2(0.0f, 0.0f), metric)
 {
 }
Exemple #6
0
 public Bullet(Metric metric, float intimeout, Vector2 pos, Vector2 vel)
     : base(pos, vel, metric)
 {
     bulletTexture = Tweaks.CONTENT.Load<Texture2D>("bullet");
     timeout = intimeout;
 }