Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanner committed Aug 20, 2024
1 parent 5209e36 commit 94bf525
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/entities/Player.hx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Player extends Unibody {
public static var layers = AsepriteMacros.layerNames("assets/aseprite/playerSketchpad.json");
//public static var eventData = AsepriteMacros.frameUserData("assets/aseprite/playerSketchpad.json", "Layer 1");

var gun:Gun;
public var gun:Gun;
var pistolBulletSpeed = 240;
var magnumBulletSpeed = 300;
var shottyBulletSpeed = 200;
Expand Down
10 changes: 8 additions & 2 deletions source/entities/Tink.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package entities;

import ui.WeaponUnlockOverlay;
import states.CreditsState;
import states.SplashScreenState;
import states.SplashScreenState.SplashImage;
Expand Down Expand Up @@ -125,7 +126,7 @@ class Tink extends Unibody {

distanceToPlayer = PlayState.me.player.getMidpoint().distanceTo(getMidpoint());
var checkDistance = activationRadius;
if (spawnPoint == TINK_TARGETS && dialogIndex == 1) {
if (spawnPoint == TINK_TARGETS && dialogIndex >= 1) {
// we want him to trigger as soon as you break the last target
checkDistance = 1000;
}
Expand Down Expand Up @@ -185,8 +186,13 @@ class Tink extends Unibody {
collector.isDepositable = true;
// triggerDialog(new CharacterDialog(TINK, "Blast those crappy pink squares. They're actually targest, but I don't have assets yet."));"
return;

case 1:
if (WeaponUnlockOverlay.playerHasPistol){
dialogIndex++;
triggerDialog(new CharacterDialog(TINK, "There you go! Use left click to aim and shoot!"));
}
case 2:
var targetsDone = true;
for (t in PlayState.me.practiceTargets) {
if (!t.beenShot) {
Expand Down
5 changes: 5 additions & 0 deletions source/ui/WeaponUnlockOverlay.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import flixel.FlxSubState;
class WeaponUnlockOverlay extends FlxSubState {
public static var anims = AsepriteMacros.tagNames("assets/aseprite/weaponSplashScreens.json");

public static var playerHasPistol = false;

public function new(type:GunHas) {
super();

Expand Down Expand Up @@ -70,6 +72,9 @@ class WeaponUnlockOverlay extends FlxSubState {
})).then(FlxTween.tween(bgSprite, {"alpha": 0}, 0.25, {
onComplete: (t) -> {
PlayState.me.resumeGame();
if (type == PISTOL) {
playerHasPistol = true;
}
close();
}
}));
Expand Down

0 comments on commit 94bf525

Please sign in to comment.