Example #1
0
        public override void Draw(GameTime gameTime)
        {
            if (this.CurrentState == HandState.Latched)
            {
                _renderComponent.LoadContent("Character_Hand_Down");
                _renderComponent.Draw(gameTime, Color.White);
            }
            else if (this.CurrentState == HandState.Shooting || this.CurrentState == HandState.Retreating)
            {
                _renderComponent.LoadContent("Character_Hand_Open");
                _renderComponent.Rotation = CalculateRotation(this.TargetDirection);
                _renderComponent.Draw(gameTime, Color.White);
            }
            else
            {
                // dont draw
            }



            //if (HandId == HandID.First)
            //{
            //    _renderComponent.Draw(gameTime, Color.Red);
            //}
            //else
            //{
            //    _renderComponent.Draw(gameTime, Color.Azure);
            //}

            // Draw chain
            Vector2 startPosition = _player.Position;
            Vector2 endPosition   = this.Position;
            Vector2 direction     = endPosition - startPosition;

            direction.Normalize();
            float   scale = 2.5f;
            Vector2 currentDrawPosition = startPosition;

            while (Vector2.Dot(direction, (endPosition - currentDrawPosition)) > 0)
            {
                Color color = Color.Lerp(Color.White, Color.Red, ((startPosition - endPosition).Length() / _maxDistanceOfHand));
                GameManager.Instance.SpriteBatch.Draw(chainTexture, new Rectangle((int)currentDrawPosition.X - 16, (int)currentDrawPosition.Y - 16, 32, 32), color);
                currentDrawPosition += direction * scale;
            }

            if (GameManager.Instance.DebugMode)
            {
                this.CollisionComponent?.DebugDraw(gameTime);
            }
        }
Example #2
0
 public override void Draw(GameTime gameTime)
 {
     MyrenderComponent.Draw(gameTime);
     if (count > 1)
     {
         foreach (ChainEntity ring in chain)
         {
             ring.Draw(gameTime);
         }
     }
 }
 public void Draw()
 {
     render.Draw(Position, Enums.EntityState.idle);
 }
 public void Draw()
 {
     render.Draw(Position, Enums.EntityState.idle, !isFlipped);
 }
 public void Draw()
 {
     render.Draw(Position, entityState, Velocity.X < 0);
 }