private void DrawVines(SpriteCompositionHelper helper, int frame, float cycleAngle) { float sinAngle = (float)Math.Sin(cycleAngle); Vector2 leftVine = new Vector2(-48, 78) + Vector2.One * 4 * sinAngle; Vector2 rightVine = new Vector2(64, 74) + new Vector2(1, -1) * -2 * sinAngle; // left vine helper.AddSpriteToBatch(vinesTexture, (0, 2), leftVine); helper.AddSpriteToBatch(vinesTexture, (1, 2), rightVine); }
private void DrawFoliage(SpriteCompositionHelper helper, int frame, float cycleAngle) { float sinAngle = (float)Math.Sin(cycleAngle); Vector2 leftLeaf = new Vector2(-66, -66) + Vector2.One * 2 * sinAngle; Vector2 middleLeaf = new Vector2(0, -100) + Vector2.UnitY * -3 * sinAngle; Vector2 rightLeaf = new Vector2(56, -64) + Vector2.One * -2 * sinAngle; // left leaf helper.AddSpriteToBatch(foliageTexture, (1, 3), leftLeaf); // middle leaf helper.AddSpriteToBatch(foliageTexture, (2, 3), middleLeaf); // right leaf helper.AddSpriteToBatch(foliageTexture, (0, 3), rightLeaf); }
internal override void Draw(SpriteCompositionHelper helper, int frame, float cycleAngle) { if (animationFrame < spawnFrames) { return; } for (int i = 0; i < clutterFrames.Length; i++) { // TODO figure this out programatically int maxHeight = 30; int yOffset = Math.Min(maxHeight, 2 * (animationFrame - spawnFrames - 4 * i)); if (yOffset < 0 || clutterFrames[i] == -1) { continue; } Vector2 offset = new Vector2(-24 + 16 * i, -yOffset); int idx = clutterFrames[i]; Rectangle bounds = new Rectangle((clutterWidth + 2) * idx, 0, clutterWidth, clutterHeight); helper.AddSpriteToBatch(clutterTexture, bounds, offset, 0, 1); } }
private void DrawBody(SpriteCompositionHelper helper, int frame, float cycleAngle) { // body helper.AddSpriteToBatch(bodyTexture, (projectile.frame, 5), Vector2.Zero); }