예제 #1
0
 public override void Draw(SpriteBatch sb)
 {
     if (startBody != null)
     {
         SpriteHelper.DrawLine(sb, ProjectionHelper.FarseerToPixel(startBody.GetWorldPoint(startBodyLocal)), game.inputManager.inputHelper.MousePosition, 2f, Color.Blue);
     }
 }
예제 #2
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            if (state == ObeliskState.Firing)
            {
                SpriteHelper.DrawLine(spriteBatch, PositionVector - new Vector2(2, 17), target.PositionVector, Color.Red, ZOrder.Projectiles);
            }
        }
예제 #3
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            int x = Position.X - Sprites.A10.Width / 2;
            int y = Position.Y - Sprites.A10.Height / 2;

            spriteBatch.Draw(Sprites.Shadow.Texture, new Rectangle(x, y + FlyingHeight, Sprites.Shadow.Width, Sprites.Shadow.Height), Color.White);

            if (TsGame.DebugEnabled)
            {
                SpriteHelper.DrawLine(spriteBatch, PositionVector, VectorHelpers.MoveInDirection(PositionVector, Rotation, 50), Color.White, ZOrder.Debug);
            }

            base.Draw(spriteBatch);
        }
예제 #4
0
        /*protected override bool shouldFire(Vector3 hand, Vector3 handVel, Vector3 shoulder)
         * {
         *  if (handVel.Length() > SPEED_THRESHOLD)
         *  {
         *
         *
         *      Vector2 shoulderToHand = hand - shoulder;
         *      if (shoulderToHand.Length() > EXTENSION_THRESHOLD)
         *      {
         *          handVel.Normalize();
         *          shoulderToHand.Normalize();
         *          if (Vector2.Dot(handVel, shoulderToHand) > .6f)
         *          {
         *              Console.WriteLine("Silked ");
         *              return true;
         *          }
         *          else
         *          {
         *              Console.WriteLine("Off Kilter");
         *          }
         *      }
         *      else
         *      {
         *          Console.WriteLine("Not extended " + shoulderToHand.Length());
         *      }
         *  }
         *
         *
         *
         *  return false;
         * }*/

        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            base.Draw(sb);

            if (leftSilk != null)
            {
                SpriteHelper.DrawLine(sb, leftSilk.WorldAnchorA, leftSilk.WorldAnchorB, .2f, Color.Orange);
            }

            if (rightSilk != null)
            {
                SpriteHelper.DrawLine(sb, rightSilk.WorldAnchorA, rightSilk.WorldAnchorB, .2f, Color.Orange);
            }
        }
예제 #5
0
        public override void Draw(SpriteBatch sb)
        {
            Vector2 fireVec     = new Vector2((float)Math.Cos(body.Rotation), (float)Math.Sin(body.Rotation));
            Vector2 fireLoc     = body.Position + fireVec * (barrelLength + .3f);
            Vector2 endPosition = body.Position + fireVec * 20;

            if (state == State.Firing)
            {
                Color c = new Color(1, 0, 0, (chargeTime - chargeCount) * 1.0f / chargeTime);
                SpriteHelper.DrawLine(sb, fireLoc, endPosition, .1f, c);
            }

            if (glowCount > 0)
            {
                glowCount--;
                SpriteHelper.DrawLine(sb, fireLoc, stoppingPoint, .4f, Color.Red);
            }
        }
예제 #6
0
        public override void Draw(SpriteBatch sb)
        {
            if (polyPoints.First != null)
            {
                LinkedListNode <Vector2> a = polyPoints.First;
                LinkedListNode <Vector2> b = polyPoints.First.Next;

                while (b != null)
                {
                    SpriteHelper.DrawLine(sb, ProjectionHelper.FarseerToPixel(a.Value), ProjectionHelper.FarseerToPixel(b.Value), 2f, Color.Black);

                    a = b;
                    b = b.Next;
                }

                SpriteHelper.DrawLine(sb, ProjectionHelper.FarseerToPixel(a.Value), game.inputManager.inputHelper.MousePosition, 2f, Color.Blue);
            }
        }