Skip to content

Commit

Permalink
tink cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MondayHopscotch committed Aug 20, 2024
1 parent 7aeeb07 commit 0f0cba4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 11 additions & 1 deletion source/entities/PracticeTarget.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package entities;

import flixel.util.FlxTimer;
import loaders.Aseprite;
import loaders.AsepriteMacros;
import echo.data.Data.CollisionData;
Expand Down Expand Up @@ -31,10 +32,17 @@ class PracticeTarget extends Unibody {
}
]
});

animation.finishCallback = (name) -> {
if (name == anims.drop) {
beenShot = true;
}
}
}

override function update(elapsed:Float) {
super.update(elapsed);

}

override function handleEnter(other:Body, data:Array<CollisionData>) {
Expand All @@ -45,7 +53,9 @@ class PracticeTarget extends Unibody {
body.active = false;
FmodManager.PlaySoundOneShot(FmodSFX.TargetHit2);
animation.play(anims.drop);
beenShot = true;
new FlxTimer().start(0.2, (t) -> {
beenShot = true;
});
}
}
}
7 changes: 6 additions & 1 deletion source/entities/Tink.hx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ class Tink extends Unibody {
}

distanceToPlayer = PlayState.me.player.getMidpoint().distanceTo(getMidpoint());
if (distanceToPlayer < activationRadius) {
var checkDistance = activationRadius;
if (spawnPoint == TINK_TARGETS && dialogIndex == 1) {
// we want him to trigger as soon as you break the last target
checkDistance = 1000;
}
if (distanceToPlayer < checkDistance) {

switch (spawnPoint) {
case TINK_INTRO:
Expand Down

0 comments on commit 0f0cba4

Please sign in to comment.