Ejemplo n.º 1
0
 public Entity(Vector2 position, Gun gun)
 {
     Position   = position;
     CurrentGun = gun;
     EntityType = EntityType.NPC;
     Dimensions = new EntityDimensions
     {
         Width  = EntityConstants.DimensionConstants.Base_Width_Value,
         Height = EntityConstants.DimensionConstants.Base_Height_Value
     };
 }
Ejemplo n.º 2
0
        public Bullet Shoot(Vector2 entityCurrentPos, EntityDimensions dimensions, ActionConstants direction)
        {
            Vector2 position;
            var     yPos = entityCurrentPos.Y + (dimensions.Height / 2) + 50;

            if (direction == ActionConstants.RIGHT)
            {
                var xPos = entityCurrentPos.X + dimensions.Width;
                position = new Vector2(xPos, yPos);
            }
            else
            {
                var xPos = entityCurrentPos.X - dimensions.Width;
                position = new Vector2(xPos, yPos);
            }

            return(bulletFactory.CreateBullet(bulletType, position, direction));
        }