Example #1
0
        public Holly(XmasLog boss, CustomSpriterAnimator animator)
        {
            _boss         = boss;
            _animator     = animator.Clone();
            _angularSpeed = 5f;

            var hollyLeafPosition = SpriterUtils.GetWorldPosition("holly-leaf.png", boss.CurrentAnimator);

            Position(hollyLeafPosition);
            _animator.Play("Growth");

            _animator.AnimationFinished += AnimationFinished;

            // Physics
            _boundingBoxes = new List <CollisionElement>
            {
                new SpriterCollisionCircle(this, "holly-leaf.png", new Vector2(-30, 0), 0.4f, "holly-leaf"),
                new SpriterCollisionCircle(this, "holly-leaf.png", new Vector2(45, 10), 0.3f, "holly-leaf"),
                new SpriterCollisionCircle(this, "holly-leaf.png", new Vector2(-30, 0), 0.4f, "holly-leaf_000"),
                new SpriterCollisionCircle(this, "holly-leaf.png", new Vector2(45, 10), 0.3f, "holly-leaf_000"),
                new SpriterCollisionCircle(this, "holly-leaf.png", new Vector2(-30, 0), 0.4f, "holly-leaf_001"),
                new SpriterCollisionCircle(this, "holly-leaf.png", new Vector2(45, 10), 0.3f, "holly-leaf_001"),
                new SpriterCollisionCircle(this, "holly-balls.png", Vector2.Zero, 0.8f)
            };

            foreach (var boundingBox in _boundingBoxes)
            {
                _boss.AddHitBox(boundingBox);
            }

            MoveTo(_boss.Game.ViewportAdapter.Center.ToVector2());
        }
Example #2
0
 public BabyLog(XmasLog boss, CustomSpriterAnimator animator, Vector2 position)
 {
     _boss     = boss;
     _animator = animator.Clone();
     Position(position);
 }