public Bird() { body = new SpriteBody(); Sprite tempSprite = new Sprite("henLeg"); tempSprite.Origin = new Vector2(75, 20); BodyPart b = new BodyPart("LegLeft", tempSprite, new Vector2(-30, 130)); b.SetPositionAnimation(new Vector2(-30, 140), new Vector2(-30, 120), 0.1f); body.AddBodyPart(b); tempSprite = new Sprite("henLeg"); tempSprite.Origin = new Vector2(75, 20); b = new BodyPart("LegRight", tempSprite, new Vector2(-80, 130)); b.SetPositionAnimation(new Vector2(-80, 140), new Vector2(-80, 120), 0.1f, false); body.AddBodyPart(b); body.AddBodyPart("Body", new Sprite("henBody")); tempSprite = new Sprite("henWing"); tempSprite.Origin = new Vector2(190, 30); b = new BodyPart("Wing", tempSprite, new Vector2(-120, 0)); b.SetRotationAnimation(-0.4f, 0.9f, 0.1f); body.AddBodyPart(b); body.scale = 0.7f; sprite = new Sprite("pixel"); firstCall = true; speed = 8; }
public void AddBodyPart(string name, Sprite sprite, Vector2 position) { BodyPart b = new BodyPart(name, sprite, position); AddBodyPart(b); }
public void AddBodyPart(BodyPart bodyPart) { if (bodyParts == null) bodyParts = new List<BodyPart>(); bodyParts.Add(bodyPart); }