Skip to content

Commit f136494

Browse files
committed
Switch parameter order in DreamHoldable constructor
1 parent 83a1770 commit f136494

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/Components/DreamHoldable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public bool AllowDreamDash
1717

1818
private readonly Action onActivate, onDeactivate;
1919

20-
public DreamHoldable(Collider dreamDashCollider, Action onActivate = null, Action onDeactivate = null, float cannotHoldDelay = 0.1f)
20+
public DreamHoldable(Collider dreamDashCollider, float cannotHoldDelay = 0.1f, Action onActivate = null, Action onDeactivate = null)
2121
: base(cannotHoldDelay)
2222
{
2323
DreamDashCollider = new DreamDashCollider(dreamDashCollider, OnDreamDashEnter, OnDreamDashExit);

src/Entities/DreamBlocks/DreamJellyfish.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public DreamJellyfish(Vector2 position, bool bubble, bool tutorial)
4040
Remove(Hold);
4141
Add(Hold = DreamHold = new DreamHoldable(
4242
new Hitbox(28, 16, -13, -18),
43+
0.3f,
4344
() =>
4445
{
4546
dreamSprite.Enabled = true;
@@ -52,8 +53,7 @@ public DreamJellyfish(Vector2 position, bool bubble, bool tutorial)
5253
dreamSprite.Enabled = false;
5354
dreamSprite.Flash = 1f;
5455
Audio.Play(CustomSFX.game_dreamJellyfish_jelly_use);
55-
},
56-
0.3f
56+
}
5757
)
5858
{
5959
PickupCollider = new Hitbox(20f, 22f, -10f, -16f),
@@ -69,7 +69,7 @@ public DreamJellyfish(Vector2 position, bool bubble, bool tutorial)
6969
},
7070
});
7171

72-
// The Dreamdash Collider does not shift down when this entity is inverted (via GravityHelper)
72+
// The Dreamdash Collider does not shift down when this entity is inverted (via GravityHelper).
7373
// So let's add a listener that does this for us.
7474
Component listener = GravityHelper.CreateGravityListener?.Invoke(this, (_, value, _) =>
7575
{

src/Entities/DreamBlocks/DreamTheoCrystal.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ internal class DreamTheoCrystal : TheoCrystal
2121

2222
public DreamTheoCrystal(EntityData data, Vector2 offset) : base(data, offset)
2323
{
24-
Add(overlaySprite = CommunalHelperGFX.SpriteBank.Create("dreamTheoCrystalOverlay"));
25-
2624
Remove(sprite);
2725
Add(sprite = dreamSprite = new DreamSprite(CommunalHelperGFX.SpriteBank.Create("dreamTheoCrystal"), particleBounds)
2826
{
2927
OnChange = (_, current) => overlaySprite.Play(current, true)
3028
});
3129

30+
Add(overlaySprite = CommunalHelperGFX.SpriteBank.Create("dreamTheoCrystalOverlay"));
31+
3232
Remove(Hold);
3333
Add(Hold = DreamHold = new DreamHoldable(
3434
new Hitbox(20, 20, -10, -20),
35+
0.1f,
3536
() =>
3637
{
3738
dreamSprite.Enabled = true;
@@ -43,8 +44,7 @@ public DreamTheoCrystal(EntityData data, Vector2 offset) : base(data, offset)
4344
dreamSprite.Enabled = false;
4445
dreamSprite.Flash = 1f;
4546
Audio.Play(CustomSFX.game_dreamJellyfish_jelly_use);
46-
},
47-
0.1f
47+
}
4848
)
4949
{
5050
PickupCollider = new Hitbox(16f, 22f, -8f, -16f),
@@ -64,12 +64,14 @@ public DreamTheoCrystal(EntityData data, Vector2 offset) : base(data, offset)
6464
},
6565
});
6666

67-
// The Dreamdash Collider does not shift down when this entity is inverted (via GravityHelper)
68-
// So let's add a listener that does this for us.
67+
// The Dreamdash Collider does not shift down when this entity is inverted (via GravityHelper).
68+
// Nor does the overlay sprite get flipped.
69+
// So let's add a listener that does both of these for us.
6970
Component listener = GravityHelper.CreateGravityListener?.Invoke(this, (_, value, _) =>
7071
{
7172
bool inverted = value == (int) GravityType.Inverted;
72-
DreamHold.DreamDashCollider.Collider.Position.Y = inverted ? 0 : -18; // a bit hacky
73+
DreamHold.DreamDashCollider.Collider.Position.Y = inverted ? 0 : -20; // a bit hacky
74+
overlaySprite.Scale.Y = inverted ? -1 : 1;
7375
});
7476
if (listener is not null)
7577
Add(listener);

0 commit comments

Comments
 (0)