Exemple #1
0
    public void Rule1(float dt, World world)
    {
      Asteroids = (

    (Asteroids).Select(__ContextSymbol8 => new { ___a11 = __ContextSymbol8 })
    .Where(__ContextSymbol9 => ((1500f) > (__ContextSymbol9.___a11.Position.Y)))
    .Select(__ContextSymbol10 => __ContextSymbol10.___a11)
    .ToList<Asteroid>()).ToList<Asteroid>();
    }
Exemple #2
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
   // TODO: Add your initialization logic here
   world = new World();
   world.Start();
   NetPeerConfiguration config = new NetPeerConfiguration("AsteroidShooter");
   NetworkAPI.Client = new NetClient(config);
   NetworkAPI.Client.Start();
   NetworkAPI.Client.Connect("127.0.0.1", 5432);
   base.Initialize();
 }
Exemple #3
0
    public void Update(float dt, World world)
    {
      var t = System.DateTime.Now; this.Rule0(dt, world);
      this.Rule1(dt, world);
      this.Rule3(dt, world);
      this.Rule4(dt, world);
      for (int x0 = 0; x0 < Asteroids.Count; x0++)
      {
        Asteroids[x0].Update(dt, world);
      }
      Ship.Update(dt, world);
      this.Rule2(dt, world);

    }
Exemple #4
0
    public void Rule0(float dt, World world)
    {
      CollidingProjectiles = (

    (Asteroids).Select(__ContextSymbol5 => new { ___a00 = __ContextSymbol5 })
    .SelectMany(__ContextSymbol6 => (Ships).Select(__ContextSymbol7 => new {
      ___s00 = __ContextSymbol7,
      prev = __ContextSymbol6
    })
    .SelectMany(__ContextSymbol8 => (__ContextSymbol8.___s00.Projectiles).Select(__ContextSymbol9 => new {
      ___p00 = __ContextSymbol9,
      prev = __ContextSymbol8
    })
    .Where(__ContextSymbol10 => ((150f) > (Microsoft.Xna.Framework.Vector2.Distance(__ContextSymbol10.prev.prev.___a00.Position, __ContextSymbol10.___p00.Position))))
    .Select(__ContextSymbol11 => __ContextSymbol11.___p00)
    .ToList<Projectile>()))).ToList<Projectile>();
    }
Exemple #5
0
    public void Rule0(float dt, World world)
    {
      Asteroids = (

    (Asteroids).Select(__ContextSymbol1 => new { ___a00 = __ContextSymbol1 })
    .Select(__ContextSymbol2 => new {
      ___projs00 = (

    (Ship.Projectiles).Select(__ContextSymbol3 => new { ___p00 = __ContextSymbol3, prev = __ContextSymbol2 })
    .Where(__ContextSymbol4 => ((50) > (Microsoft.Xna.Framework.Vector2.Distance(__ContextSymbol4.prev.___a00.Position, __ContextSymbol4.___p00.Position))))
    .Select(__ContextSymbol5 => __ContextSymbol5.___p00)
    .ToList<Projectile>()).ToList<Projectile>(),
      prev = __ContextSymbol2
    })
    .Where(__ContextSymbol6 => ((__ContextSymbol6.___projs00.Count) == (0)))
    .Select(__ContextSymbol7 => __ContextSymbol7.prev.___a00)
    .ToList<Asteroid>()).ToList<Asteroid>();
    }
Exemple #6
0
 public void Rule0(float dt, World world)
 {
   Position = (Position) + ((new Microsoft.Xna.Framework.Vector2(0f, 250f)) * (dt));
 }
Exemple #7
0
    public void Update(float dt, World world)
    {
      frame = World.frame; this.Rule0(dt, world);



    }
Exemple #8
0
    public void Rule3(float dt, World world)
    {
      switch (s3)
      {

        case -1:
          ___vy31 = new Microsoft.Xna.Framework.Vector2(-300f, 0f);
          goto case 1;
        case 1:
          if (!(world.State.IsKeyDown(Keys.A)))
          {

            s3 = 1;
            return;
          }
          else
          {

            goto case 0;
          }
        case 0:
          Position = ((Position) + (((___vy31) * (dt))));
          s3 = -1;
          return;
        default: return;
      }
    }
Exemple #9
0
    public void Rule0(float dt, World world)
    {
      switch (s0)
      {

        case -1:
          if (!(KeyboardManager.KeyboardInput.GetKeyPressed(world.Input, Keys.Q)))
          {

            s0 = -1;
            return;
          }
          else
          {

            goto case 0;
          }
        case 0:
          Projectiles = new Cons<Projectile>(new Projectile(Position), (Projectiles)).ToList<Projectile>();
          s0 = -1;
          return;
        default: return;
      }
    }
Exemple #10
0
    public void Rule1(float dt, World world)
    {
      Projectiles = (

    (Projectiles).Select(__ContextSymbol13 => new { ___p11 = __ContextSymbol13 })
    .Where(__ContextSymbol14 => ((__ContextSymbol14.___p11.Position.Y) > (-50f)))
    .Select(__ContextSymbol15 => __ContextSymbol15.___p11)
    .ToList<Projectile>()).ToList<Projectile>();
    }
Exemple #11
0
    public void Update(float dt, World world)
    {
      frame = World.frame; this.Rule1(dt, world);

      this.Rule0(dt, world);
      this.Rule2(dt, world);
      this.Rule3(dt, world);
      for (int x0 = 0; x0 < Projectiles.Count; x0++)
      {
        Projectiles[x0].Update(dt, world);
      }
    }
Exemple #12
0
    public void Rule7(float dt, World world)
    {
      switch (s7)
      {

        case -1:
          ___randomPos70 = new Microsoft.Xna.Framework.Vector2(Utilities.Random.RandFloat(0f, 1500f), -50f);
          ___randomWait70 = Utilities.Random.RandFloat(0.5f, 3f);
          Asteroids = new Cons<Asteroid>(new Asteroid(___randomPos70), (Asteroids)).ToList<Asteroid>();
          s7 = 0;
          return;
        case 0:
          count_down1 = ___randomWait70;
          goto case 1;
        case 1:
          if (((count_down1) > (0f)))
          {

            count_down1 = ((count_down1) - (dt));
            s7 = 1;
            return;
          }
          else
          {

            s7 = -1;
            return;
          }
        default: return;
      }
    }
Exemple #13
0
 public void Rule4(float dt, World world)
 {
   State = Microsoft.Xna.Framework.Input.Keyboard.GetState();
 }
Exemple #14
0
    public void Rule2(float dt, World world)
    {
      switch (s2)
      {

        case -1:
          if (!(((ColliderShipAsteroid.Count) > (0))))
          {

            s2 = -1;
            return;
          }
          else
          {

            goto case 1;
          }
        case 1:
          ___updatedAsteroids20 = (

        (Asteroids).Select(__ContextSymbol30 => new { ___a21 = __ContextSymbol30 })
        .Select(__ContextSymbol31 => new {
          ___colliders20 = (

        (ColliderShipAsteroid).Select(__ContextSymbol32 => new { ___c20 = __ContextSymbol32, prev = __ContextSymbol31 })
        .Where(__ContextSymbol33 => ((__ContextSymbol33.___c20.Item2) == (__ContextSymbol33.prev.___a21)))
        .Select(__ContextSymbol34 => __ContextSymbol34.___c20.Item2)
        .ToList<Asteroid>()).ToList<Asteroid>(),
          prev = __ContextSymbol31
        })
        .Where(__ContextSymbol35 => ((__ContextSymbol35.___colliders20.Count) == (0)))
        .Select(__ContextSymbol36 => __ContextSymbol36.prev.___a21)
        .ToList<Asteroid>()).ToList<Asteroid>();
          ColliderShipAsteroid = (

        Enumerable.Empty<Casanova.Prelude.Tuple<Ship, Asteroid>>()).ToList<Casanova.Prelude.Tuple<Ship, Asteroid>>();
          Asteroids = ___updatedAsteroids20;
          s2 = -1;
          return;
        default: return;
      }
    }
Exemple #15
0
    public void Rule2(float dt, World world)
    {
      switch (s2)
      {

        case -1:
          if (!(world.State.IsKeyDown(Keys.Space)))
          {

            s2 = -1;
            return;
          }
          else
          {

            goto case 1;
          }
        case 1:
          Projectiles = new Cons<Projectile>(new Projectile(Position, this), (Projectiles)).ToList<Projectile>();
          s2 = 0;
          return;
        case 0:
          if (!(!(world.State.IsKeyDown(Keys.Space))))
          {

            s2 = 0;
            return;
          }
          else
          {

            s2 = -1;
            return;
          }
        default: return;
      }
    }
Exemple #16
0
    public void Rule1(float dt, World world)
    {
      switch (s1)
      {

        case -1:
          if (!(((world.ColliderShipAsteroid.Count) > (0))))
          {

            s1 = -1;
            return;
          }
          else
          {

            goto case 5;
          }
        case 5:
          ___colliders11 = (

        (world.ColliderShipAsteroid).Select(__ContextSymbol60 => new { ___c11 = __ContextSymbol60 })
        .Where(__ContextSymbol61 => ((__ContextSymbol61.___c11.Item1) == (this)))
        .Select(__ContextSymbol62 => __ContextSymbol62.___c11)
        .ToList<Casanova.Prelude.Tuple<Ship, Asteroid>>()).ToList<Casanova.Prelude.Tuple<Ship, Asteroid>>();
          if (((___colliders11.Count) > (0)))
          {

            goto case 0;
          }
          else
          {

            goto case 1;
          }
        case 0:
          Health = ((Health) - (___colliders11.Head().Item2.Damage));
          s1 = -1;
          return;
        case 1:
          Health = Health;
          s1 = -1;
          return;
        default: return;
      }
    }
Exemple #17
0
    public void Rule0(float dt, World world)
    {
      switch (s0)
      {

        case -1:
          if (!(((world.CollidingProjectiles.Count) > (0))))
          {

            s0 = -1;
            return;
          }
          else
          {

            goto case 2;
          }
        case 2:
          ___hits00 = (

        (Projectiles).Select(__ContextSymbol48 => new { ___p02 = __ContextSymbol48 })
        .SelectMany(__ContextSymbol49 => (world.CollidingProjectiles).Select(__ContextSymbol50 => new {
          ___cp00 = __ContextSymbol50,
          prev = __ContextSymbol49
        })
        .Where(__ContextSymbol51 => ((((__ContextSymbol51.prev.___p02) == (__ContextSymbol51.___cp00))) && (((__ContextSymbol51.prev.___p02.Owner) == (this)))))
        .Select(__ContextSymbol52 => __ContextSymbol52.prev.___p02)
        .ToList<Projectile>())).ToList<Projectile>();
          ___updatedProjs00 = (

        (Projectiles).Select(__ContextSymbol53 => new { ___p03 = __ContextSymbol53 })
        .Select(__ContextSymbol54 => new {
          ___hits01 = (

        (world.CollidingProjectiles).Select(__ContextSymbol55 => new { ___cp01 = __ContextSymbol55, prev = __ContextSymbol54 })
        .Where(__ContextSymbol56 => ((((__ContextSymbol56.prev.___p03) == (__ContextSymbol56.___cp01))) && (((__ContextSymbol56.prev.___p03.Owner) == (this)))))
        .Select(__ContextSymbol57 => __ContextSymbol57.prev.___p03)
        .ToList<Projectile>()).ToList<Projectile>(),
          prev = __ContextSymbol54
        })
        .Where(__ContextSymbol58 => ((__ContextSymbol58.___hits01.Count) == (0)))
        .Select(__ContextSymbol59 => __ContextSymbol59.prev.___p03)
        .ToList<Projectile>()).ToList<Projectile>();
          Projectiles = ___updatedProjs00;
          Score = ((Score) + (___hits00.Count));
          s0 = -1;
          return;
        default: return;
      }
    }
Exemple #18
0
    public void Rule3(float dt, World world)
    {
      Projectiles = (

    (Projectiles).Select(__ContextSymbol45 => new { ___p34 = __ContextSymbol45 })
    .Where(__ContextSymbol46 => ((__ContextSymbol46.___p34.Position.Y) > (-50f)))
    .Select(__ContextSymbol47 => __ContextSymbol47.___p34)
    .ToList<Projectile>()).ToList<Projectile>();
    }
Exemple #19
0
    public void Rule6(float dt, World world)
    {
      Asteroids = (

    (Asteroids).Select(__ContextSymbol27 => new { ___a65 = __ContextSymbol27 })
    .Where(__ContextSymbol28 => ((1500f) > (__ContextSymbol28.___a65.Position.Y)))
    .Select(__ContextSymbol29 => __ContextSymbol29.___a65)
    .ToList<Asteroid>()).ToList<Asteroid>();
    }
Exemple #20
0
    public void Rule4(float dt, World world)
    {
      CollidingAsteroids = (

    (Asteroids).Select(__ContextSymbol20 => new { ___a43 = __ContextSymbol20 })
    .SelectMany(__ContextSymbol21 => (Ships).Select(__ContextSymbol22 => new {
      ___s43 = __ContextSymbol22,
      prev = __ContextSymbol21
    })
    .SelectMany(__ContextSymbol23 => (__ContextSymbol23.___s43.Projectiles).Select(__ContextSymbol24 => new {
      ___p41 = __ContextSymbol24,
      prev = __ContextSymbol23
    })
    .Where(__ContextSymbol25 => ((150f) > (Microsoft.Xna.Framework.Vector2.Distance(__ContextSymbol25.prev.prev.___a43.Position, __ContextSymbol25.___p41.Position))))
    .Select(__ContextSymbol26 => __ContextSymbol26.prev.prev.___a43)
    .ToList<Asteroid>()))).ToList<Asteroid>();
    }
Exemple #21
0
    public void Rule5(float dt, World world)
    {
      switch (s5)
      {

        case -1:
          if (!(((CollidingAsteroids.Count) > (0))))
          {

            s5 = -1;
            return;
          }
          else
          {

            goto case 0;
          }
        case 0:
          Asteroids = (

        (Asteroids).Select(__ContextSymbol38 => new { ___a54 = __ContextSymbol38 })
        .SelectMany(__ContextSymbol39 => (CollidingAsteroids).Select(__ContextSymbol40 => new {
          ___ca50 = __ContextSymbol40,
          prev = __ContextSymbol39
        })
        .Where(__ContextSymbol41 => !(((__ContextSymbol41.prev.___a54) == (__ContextSymbol41.___ca50))))
        .Select(__ContextSymbol42 => __ContextSymbol42.prev.___a54)
        .ToList<Asteroid>())).ToList<Asteroid>();
          s5 = -1;
          return;
        default: return;
      }
    }
Exemple #22
0
    public void Rule3(float dt, World world)
    {
      new Casanova.Prelude.Tuple<Microsoft.Xna.Framework.Input.KeyboardState, Microsoft.Xna.Framework.Input.KeyboardState>(Input.CurrentState, Input.OldState);
	}
Exemple #23
0
    public void Rule1(float dt, World world)
    {
      Ships = (

    (Ships).Select(__ContextSymbol12 => new { ___s11 = __ContextSymbol12 })
    .Where(__ContextSymbol13 => ((__ContextSymbol13.___s11.Health) > (0)))
    .Select(__ContextSymbol14 => __ContextSymbol14.___s11)
    .ToList<Ship>()).ToList<Ship>();
    }
Exemple #24
0
    public void Rule2(float dt, World world)
    {
      switch (s2)
      {

        case -1:
          Asteroids = new Cons<Asteroid>(new Asteroid(new Microsoft.Xna.Framework.Vector2(250f, -50f)), (Asteroids)).ToList<Asteroid>();
          s2 = 0;
          return;
        case 0:
          count_down1 = 3f;
          goto case 1;
        case 1:
          if (((count_down1) > (0f)))
          {

            count_down1 = ((count_down1) - (dt));
            s2 = 1;
            return;
          }
          else
          {

            s2 = -1;
            return;
          }
        default: return;
      }
    }
Exemple #25
0
    public void Rule3(float dt, World world)
    {
      ColliderShipAsteroid = (

    (Asteroids).Select(__ContextSymbol15 => new { ___a32 = __ContextSymbol15 })
    .SelectMany(__ContextSymbol16 => (Ships).Select(__ContextSymbol17 => new {
      ___s32 = __ContextSymbol17,
      prev = __ContextSymbol16
    })
    .Where(__ContextSymbol18 => ((150f) > (Microsoft.Xna.Framework.Vector2.Distance(__ContextSymbol18.prev.___a32.Position, __ContextSymbol18.___s32.Position))))
    .Select(__ContextSymbol19 => new Casanova.Prelude.Tuple<Ship, Asteroid>(__ContextSymbol19.___s32, __ContextSymbol19.prev.___a32))
    .ToList<Casanova.Prelude.Tuple<Ship, Asteroid>>())).ToList<Casanova.Prelude.Tuple<Ship, Asteroid>>();
    }