Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Code/FLCC/CustomPuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public enum BoostModes
private bool tangible = true;
private bool renderEye = true;

public CustomPuffer(Vector2 position, bool faceRight, float angle = 0f, float radius = 32f, float launchSpeed = 280f, string spriteName = "pufferFish")
public CustomPuffer(Vector2 position, bool faceRight, float angle = 0f, float radius = 32f, float launchSpeed = 280f, string spriteName = "pufferFish", bool isStatic = false)
: base(position)
{
Collider = new Hitbox(12f, 10f, -6f, -5f);
Expand All @@ -98,8 +98,12 @@ public CustomPuffer(Vector2 position, bool faceRight, float angle = 0f, float ra
Facing.X = -1f;
}
idleSine = new SineWave(0.5f, 0f);
idleSine.Randomize();
Add(idleSine);
if(!isStatic)
{
idleSine.Randomize();
}
this.isStatic = isStatic;
Add(idleSine);
anchorPosition = Position;
Position += new Vector2(idleSine.Value * 3f, idleSine.ValueOverTwo * 2f);
State = States.Idle;
Expand All @@ -122,13 +126,12 @@ public CustomPuffer(Vector2 position, bool faceRight, float angle = 0f, float ra
}

public CustomPuffer(EntityData data, Vector2 offset, EntityID id)
: this(data.Position + offset, data.Bool("right", false), data.Float("angle", 0f), data.Float("radius", 32f), data.Float("launchSpeed", 280f), data.Attr("sprite", "pufferFish"))
: this(data.Position + offset, data.Bool("right", false), data.Float("angle", 0f), data.Float("radius", 32f), data.Float("launchSpeed", 280f), data.Attr("sprite", "pufferFish"), data.Bool("static",false))
{
ID = id;

respawnTime = data.Float("respawnTime", 2.5f);
alwaysShowOutline = data.Bool("alwaysShowOutline");
isStatic = data.Bool("static");
pushAny = data.Bool("pushAnyDir");
oneUse = data.Bool("oneUse");
deathFlag = data.Attr("deathFlag");
Expand Down
Loading