diff --git a/scripts/Contents/Characters/Bear.gd b/scripts/Contents/Characters/Bear.gd index f8015aa..888e839 100644 --- a/scripts/Contents/Characters/Bear.gd +++ b/scripts/Contents/Characters/Bear.gd @@ -122,8 +122,8 @@ func attack(type): return false return true func sprint(): - var dir = sign((currentFocusedBoss.position - position).x) - velocity = Vector2(dir, 0) + if is_instance_valid(currentFocusedBoss): + velocity = Vector2(sign((currentFocusedBoss.position - position).x), 0) func sprintAi(): velocity.x *= 1.2 return abs(velocity.x) >= 1000000 diff --git a/scripts/Contents/Wave.gd b/scripts/Contents/Wave.gd index ae5f48c..4635466 100644 --- a/scripts/Contents/Wave.gd +++ b/scripts/Contents/Wave.gd @@ -22,7 +22,7 @@ func duplicate() -> Wave: wave.per = per return wave -static var current: int = startWith(1) if WorldManager.isRelease() else startWith(5) +static var current: int = startWith(1) if WorldManager.isRelease() else startWith(1) static var WAVE_NORMAL = [ Wave.create("Hen", 1, 3, false, 0, INF, 1), Wave.create("Cat", 1, 3, false, 0, INF, 1), @@ -47,7 +47,7 @@ static var WAVE_TESTBOSS_CHICK = [ Wave.create("Chick", 0, 0, true, 0, INF, 10), ] static var WAVE_EMPTY = [] -static var data = WAVE_NORMAL if WorldManager.isRelease() else WAVE_TESTBOSS_ALL +static var data = WAVE_NORMAL if WorldManager.isRelease() else WAVE_TESTBOSS_BEAR static func create( entity_: String, diff --git a/scripts/Tools/TickTool.gd b/scripts/Tools/TickTool.gd index f19647b..e7a4a59 100644 --- a/scripts/Tools/TickTool.gd +++ b/scripts/Tools/TickTool.gd @@ -7,7 +7,7 @@ static func frame(count: int = 1): await WorldManager.tree.physics_frame static func until(predicate: Callable): while not predicate.call(): - await frame() + await frame.unbind(1).call(0) static func modifyAnimationKey(animator: AnimationPlayer, name: String, track: NodePath, trackType: Animation.TrackType, time: float, value: Variant): var animation = animator.get_animation(name) var trackIdx = animation.find_track(track, trackType)