Camera transitions can now force bump a player over a threshold.
This commit is contained in:
parent
36828498c4
commit
0194c26e8e
|
|
@ -22,7 +22,7 @@ __meta__ = {
|
|||
}
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 14 )]
|
||||
position = Vector2( 506, 35 )
|
||||
position = Vector2( 1063, 116 )
|
||||
|
||||
[node name="CameraControl" type="Position2D" parent="."]
|
||||
pause_mode = 2
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ onready var timer: Timer = $Timer
|
|||
#onready var parent = $Player
|
||||
|
||||
##TODO: Quick and dirty because we need to pause these
|
||||
#onready var player_node = $"../Player"
|
||||
onready var player_node :KinematicBody2D = $"../Player"
|
||||
#onready var level_node = $"../Level"
|
||||
|
||||
func _ready():
|
||||
|
|
@ -57,6 +57,7 @@ func update_grid_position():
|
|||
$Camera2D.smoothing_enabled = true
|
||||
jump_to_grid_position()
|
||||
#wait for stability.
|
||||
player_node.global_translate(Vector2(0,-10))
|
||||
yield(timer, "timeout")
|
||||
$Camera2D.smoothing_enabled = false
|
||||
get_tree().paused = false
|
||||
|
|
@ -66,7 +67,10 @@ func update_grid_position():
|
|||
timer.start()
|
||||
$Camera2D.smoothing_enabled = true
|
||||
jump_to_grid_position()
|
||||
#wait for stability.
|
||||
# FINALLY Got one that works. I tried all sorts of stuff to move this thing!?
|
||||
player_node.global_translate(Vector2(0,10))
|
||||
# while(timer.time_left > 0):
|
||||
# timer.time_left / timer.wait_time
|
||||
yield(timer, "timeout")
|
||||
$Camera2D.smoothing_enabled = false
|
||||
get_tree().paused = false
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user