Compare commits

..

No commits in common. "ff8c3ef75220f9bbee6b5e69a33d8e46954f6690" and "5438bc9ffdb4c1f788dc93213e7692933491760a" have entirely different histories.

1 changed files with 1 additions and 16 deletions

View File

@ -9,25 +9,10 @@ var target: Targetable = null
var camera_tweening = false var camera_tweening = false
var time_targets := Dictionary()
func _ready(): func _ready():
set_target(initial_target, false) set_target(initial_target, false)
camera.set_as_top_level(true) camera.set_as_top_level(true)
ControllerEventBus.billiard_touched_billiard.connect(_on_billiard_touched_billiard) ControllerEventBus.billiard_touched_billiard.connect(_on_billiard_touched_billiard)
TAS_System.FrameIncremented.connect(frame_inc)
TAS_System.FramesAdvanced.connect(frames_change)
TAS_System.FramesRegressed.connect(frames_change)
func frame_inc(frame: int):
time_targets[frame] = target
func frames_change(start: int, end: int):
if time_targets[end] != target:
set_target(time_targets[end].get_billiard())
func _on_billiard_touched_billiard(who: Billiard, touched: Billiard): func _on_billiard_touched_billiard(who: Billiard, touched: Billiard):
var who_target = Targetable.is_targetable(who) var who_target = Targetable.is_targetable(who)
@ -86,8 +71,8 @@ func release():
%ChargeReleaseSound.volume_db = get_charge() * 12 %ChargeReleaseSound.volume_db = get_charge() * 12
%ChargeReleaseSound.play() %ChargeReleaseSound.play()
var billiard := target.get_billiard() var billiard := target.get_billiard()
TAS_System.StartIncrementingFrames()
billiard.hit((target.global_position - %camera_spot.global_position).normalized(), get_charge()) billiard.hit((target.global_position - %camera_spot.global_position).normalized(), get_charge())
TAS_System.StartIncrementingFrames()
%radial_ui.set_charge(0.0) %radial_ui.set_charge(0.0)
%ChargeSound.stop() %ChargeSound.stop()