Compare commits
2 Commits
5438bc9ffd
...
ff8c3ef752
Author | SHA1 | Date |
---|---|---|
Spencer Killen | ff8c3ef752 | |
Spencer Killen | a7c1092f50 |
|
@ -9,10 +9,25 @@ var target: Targetable = null
|
|||
|
||||
var camera_tweening = false
|
||||
|
||||
var time_targets := Dictionary()
|
||||
|
||||
func _ready():
|
||||
set_target(initial_target, false)
|
||||
camera.set_as_top_level(true)
|
||||
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):
|
||||
var who_target = Targetable.is_targetable(who)
|
||||
|
@ -71,8 +86,8 @@ func release():
|
|||
%ChargeReleaseSound.volume_db = get_charge() * 12
|
||||
%ChargeReleaseSound.play()
|
||||
var billiard := target.get_billiard()
|
||||
billiard.hit((target.global_position - %camera_spot.global_position).normalized(), get_charge())
|
||||
TAS_System.StartIncrementingFrames()
|
||||
billiard.hit((target.global_position - %camera_spot.global_position).normalized(), get_charge())
|
||||
|
||||
%radial_ui.set_charge(0.0)
|
||||
%ChargeSound.stop()
|
||||
|
|
Loading…
Reference in New Issue