Skip to content

Commit a2d54f9

Browse files
committed
Roll back boom collider change
This broke compatibility with Eevee Helper for mysterious reasons. Not a fan of this implementation but I don't have the time for a deep dive to figure out what's happening lol. Tested with boom box zips and it still works.
1 parent 9a3b9f1 commit a2d54f9

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Code/Entities/BoomBox.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class BoomBox : Solid {
2222
SpeedMax = 24f
2323
};
2424

25-
protected Circle _boomCollider;
25+
protected readonly BoomCollider _boomCollider;
2626

2727
private readonly float _initialDelay;
2828
private readonly Sprite _sprite;
@@ -36,7 +36,7 @@ public class BoomBox : Solid {
3636
private Coroutine _sequence;
3737
private bool _steamAnger = false;
3838

39-
public BoomBox(Vector2 position, string activationId, float initialDelay, bool startActive)
39+
public BoomBox(Vector2 position, string activationId, float initialDelay, bool startActive)
4040
: base(position, 24, 24, false) {
4141
Add(Activator = new FactoryActivator());
4242
Activator.StartOn = startActive;
@@ -64,7 +64,7 @@ public BoomBox(Vector2 position, string activationId, float initialDelay, bool s
6464
_boomSprite.CenterOrigin();
6565
_boomSprite.Position = new Vector2(Width / 2, Height / 2);
6666

67-
_boomCollider = new Circle(40f, X + Width / 2, Y + Height / 2);
67+
_boomCollider = new BoomCollider(position + new Vector2(Width / 2, Height / 2));
6868
Add(_sfx = new SoundSource());
6969
_sfx.Position = new Vector2(Width / 2, Height / 2);
7070
Add(new LightOcclude(0.2f));
@@ -146,6 +146,7 @@ private IEnumerator WindDownSequence() {
146146

147147
public override void Added(Scene scene) {
148148
base.Added(scene);
149+
scene.Add(_boomCollider);
149150
Activator.HandleStartup(scene);
150151
}
151152

@@ -172,13 +173,6 @@ public override void Update() {
172173
}
173174
}
174175

175-
public override void DebugRender(Camera camera) {
176-
base.DebugRender(camera);
177-
if (Activator.IsOn) {
178-
_boomCollider.Render(camera, Color.HotPink);
179-
}
180-
}
181-
182176
private void HandleAngryMode() {
183177
CheckForAngryMode();
184178
if (_angryMode) {
@@ -223,7 +217,7 @@ private void Explode() {
223217
(Scene as Level).Displacement.AddBurst(Center, 0.35f, 4f, 64f, 0.5f);
224218
Player player = Scene.Tracker.GetEntity<Player>();
225219
Collidable = false;
226-
if (player != null && _boomCollider.Collide(player) && !Scene.CollideCheck<Solid>(player.Center, Center)) {
220+
if (player != null && player.CollideCheck(_boomCollider) && !Scene.CollideCheck<Solid>(player.Center, Center)) {
227221
if (player.Bottom < Top && player.Top > Bottom) {
228222
player.ExplodeLaunch(Center, false, true);
229223
} else {
@@ -233,5 +227,11 @@ private void Explode() {
233227

234228
Collidable = true;
235229
}
230+
231+
protected class BoomCollider : Entity {
232+
public BoomCollider(Vector2 position) : base(position) {
233+
Collider = new Circle(40f, 0, 0);
234+
}
235+
}
236236
}
237237
}

0 commit comments

Comments
 (0)