public sealed override void SetDefaults() { base.SetDefaults(); projectile.width = 44; projectile.height = 44; projectile.tileCollide = false; projectile.friendly = true; attackThroughWalls = true; useBeacon = false; frameSpeed = 5; scHelper = new SpriteCompositionHelper(this, new Rectangle(0, 0, 300, 300)) { idleCycleFrames = 160, frameResolution = 1, posResolution = 1 }; if (bodyTexture == null || foliageTexture == null || vinesTexture == null) { bodyTexture = GetTexture(Texture); foliageTexture = GetTexture(Texture + "_Foliage"); vinesTexture = GetTexture(Texture + "_Vines"); } subProjectiles = new List <LandChunkProjectile>(); }
private void DrawSmallStars(SpriteCompositionHelper helper, int frame, float cycleAngle) { // could probably be accomplished with dust for (int i = 0; i < smallStars.Count; i++) { smallStars[i].Draw(helper.spriteBatch, smallStarTexture, animationFrame); } }
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 DrawBigStars(SpriteCompositionHelper helper, int frame, float cycleAngle) { for (int i = 0; i < bigStars.Count; i++) { bigStars[i].DrawConnections(Main.projectileTexture[projectile.type], helper.spriteBatch, animationFrame); } for (int i = 0; i < bigStars.Count; i++) { bigStars[i].Draw(helper.spriteBatch, animationFrame); } }
public override void SetDefaults() { base.SetDefaults(); projectile.timeLeft = TimeToLive; smallStarTexture = ModContent.GetTexture(Texture + "_Small"); scHelper = new SpriteCompositionHelper(this, new Rectangle(0, 0, ConstellationSize, ConstellationSize)) { idleCycleFrames = projectile.timeLeft, frameResolution = 1, posResolution = 1 }; }
public override void SetDefaults() { base.SetDefaults(); projectile.width = 32; projectile.height = 32; attackFrames = 90; noLOSPursuitTime = 300; startFlyingAtTargetHeight = 96; startFlyingAtTargetDist = 64; defaultJumpVelocity = 4; searchDistance = 900; maxJumpVelocity = 12; scHelper = new SpriteCompositionHelper(this, new Rectangle(0, 0, 48, 48)); }
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); }
public override void SetDefaults() { base.SetDefaults(); projectile.width = 24; projectile.height = 24; projectile.localNPCHitCooldown = 18; projectile.minionSlots = 0; projectile.minion = false; attackThroughWalls = true; useBeacon = false; attackFrames = 60; blurHelper = new MotionBlurDrawer(4); scHelper = new SpriteCompositionHelper(this, new Rectangle(0, 0, 120, 400)) { idleCycleFrames = 160, frameResolution = 1, posResolution = 1, BaseOffset = new Vector2(0, 100) }; }
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); } }
internal abstract void Draw(SpriteCompositionHelper helper, int frame, float cycleAngle);
private void DrawBody(SpriteCompositionHelper helper, int frame, float cycleAngle) { // body helper.AddSpriteToBatch(bodyTexture, (projectile.frame, 5), Vector2.Zero); }