public Block(TextureRegion region, float x, float y)
     : base(region, x, y, BLOCK_SIZE, BLOCK_SIZE)
 {
     this.Entities = new List<Entity>();
     this.BlocksMotion = false;
     this.sprite.ZIndex = .5f;
 }
 public BulletEntity(TextureRegion region, float x, float y, float vx, float vy)
     : base(region, x, y, Block.BLOCK_SIZE / 4, Block.BLOCK_SIZE / 4)
 {
     this.velocity.X = vx;
     this.velocity.Y = vy;
     this.IsGravity = false;
     this.Collision = false;
     this.StateTime = 0;
     this.FrictionModifier = 3;
 }
        public UISpriteButton(TextureRegion region, float x, float y, float width, float height, float scale = 1)
        {
            this.scale = scale;
            this.color = Color.White;
            this.region = region;

            SetRegion(UIConfig.DEFAULT_BUTTON);
            //SetPosition(x - ((Rectangle)region).Width + width / 2, y - ((Rectangle)region).Height * scale / 2);
            //SetSize(((Rectangle)region).Width * scale, ((Rectangle)region).Height * scale);
            SetPosition(x + width / 2, y - height / 2);
            SetSize(width, height);
        }
 public Entity(TextureRegion region, float x, float y, float width, float height)
     : base(region, x, y, width, height)
 {
     this.sprite.ZIndex = .3f;
     this.IsGravity = true;
     this.Alive = true;
     this.IsGrounded = false;
     this.Collision = true;
     this.velocity = new Vector2();
     this.FrictionModifier = 1;
     this.Gravity = World.GRAVITY;
 }
 public BossEntity(TextureRegion region, float x, float y)
     : base(region, x, y, Block.BLOCK_SIZE * 4.2f, Block.BLOCK_SIZE * 4.2f)
 {
     this.Life = 50;
     this.YSpeed = 120;
     this.StateTime = 0;
     this.Counter = 0;
     this.Collision = false;
     this.Reloading = false;
     InitAnimations();
     InitFSM();
 }
        public UIImage(TextureRegion region, float x, float y, float scale = 1)
            : base(x, y, 10, 10)
        {
            this.scale = scale;
            this.color = Color.White;
            this.startPos = new Vector2(x, y);
            this.bounds = new Rectangle((int)(x - ((Rectangle)region).Width/2*scale), (int)(y - ((Rectangle)region).Height/2*scale),
                (int)(((Rectangle)region).Width*scale), (int)(((Rectangle)region).Height*scale));

            SetRegion(region);
            SetPosition(bounds.X - bounds.Width / 20, bounds.Y - bounds.Width / 10);
            SetSize(bounds.Width + bounds.Width / 10, bounds.Height + bounds.Width / 20);
        }
 public PlayerEntity(TextureRegion region, float x, float y)
     : base(region, x, y, WIDTH, HEIGHT)
 {
     this.sprite.ZIndex = .05f;
     this.speed = DEFAULT_SPEED;
     this.spawnPoint = new Vector2();
     this.direction = new Point(1, 0);
     this.jumps = 0;
     this.reloadTime = 0;
     
     InitAnimations();
     this.SetState(PlayerState.IDLE);
 }
        public Sprite(TextureRegion region, float x, float y, float width, float height) {
            this.ZIndex = 0;
            this.Region = region;
            this.Color = Color.White;
            this.Scale = new Vector2(1, 1);
            this.Size = new Vector2(width, height);
            this.DrawOffset = new Vector2();
            this.Effect = SpriteEffects.None;
            this.Position = new Vector2(x, y);
            this.Animations = new Animations();
            this.DrawOffset = new Vector2(Size.X/2, Size.Y/2);

            if (region != null)
                this.Origin = new Vector2(region.GetSource().Width / 2, region.GetSource().Height / 2);

            UpdateSizeScale();
        }
        public GroundBlock(TextureRegion region, int x, int y)
            : base(region, x, y)
        {

        }
 public AirBlock(TextureRegion region, int x, int y) : base(region, x, y)
 {
 }
 public TeleportBlock(TextureRegion region, int x, int y)
     : base(region, x, y)
 {
     this.sprite.AddAnimation("idle", new FrameAnimation(Assets.items, 0, 96, 32,32, 2, MathUtils.random(.2f, .4f))).SetAnimation("idle");
 }
 public SolidBlock(TextureRegion region, int x, int y)
     : base(region, x, y)
 {
     this.BlocksMotion = true;
 }
 public GoalBlock(TextureRegion region, int x, int y)
     : base(region, x, y)
 {
     this.BlocksMotion = false;
 }
 public BoulderEntity(TextureRegion region, float x, float y)
     : base(region, x, y, Block.BLOCK_SIZE, Block.BLOCK_SIZE)
 {
     this.FrictionModifier = 1.1f;
 }
 public SpawnEntity(TextureRegion region, float x, float y)
     : base(region, x, y, Block.BLOCK_SIZE, Block.BLOCK_SIZE)
 {
     this.IsGravity = false;
     this.Collision = false;
 }
 public EnemyEntity(TextureRegion region, float x, float y)
     : base(region, x, y, Block.BLOCK_SIZE, Block.BLOCK_SIZE / 2f)
 {
     sprite.AddAnimation("run", new FrameAnimation(Assets.crawler, 0, 0, 44, 22, 2, .21f));
     sprite.SetAnimation("run");
 }
 public void SetRegion(TextureRegion region)
 {
     this.region = region;
 }
 public void SetSprite(TextureRegion region)
 {
     this.region = region;
 }
 public Sprite SetRegion(TextureRegion region)
 {
     this.Region = region;
     UpdateSizeScale();
     return this;
 }
  public SpikeBlock(TextureRegion region, int x, int y)
     : base(region, x, y)
 {
 }