Made the player teleport and rotate exactly to starting position when the level is started
This commit is contained in:
parent
b98c3fa851
commit
8f9ad6f87c
2 changed files with 4 additions and 1 deletions
|
@ -7,7 +7,7 @@ extends Control
|
||||||
|
|
||||||
func _on_player_speed_changed(speed_float:float):
|
func _on_player_speed_changed(speed_float:float):
|
||||||
var speed_string = "%.02f" % speed_float
|
var speed_string = "%.02f" % speed_float
|
||||||
print_debug("changing speed display to ", speed_string)
|
# print_debug("changing speed display to ", speed_string)
|
||||||
speed.set_text(speed_string)
|
speed.set_text(speed_string)
|
||||||
|
|
||||||
func _on_level_distance_changed(distance_float):
|
func _on_level_distance_changed(distance_float):
|
||||||
|
|
|
@ -47,6 +47,9 @@ func _ready():
|
||||||
finish.add_point(start + finish_left)
|
finish.add_point(start + finish_left)
|
||||||
# print_debug("start: ", start, "start out: ", start_out.normalized(), " finish left: ", start + start_out.normalized().rotated(90) * width/2, "start right: ", start + start_out.normalized().rotated(-90) * width/2)
|
# print_debug("start: ", start, "start out: ", start_out.normalized(), " finish left: ", start + start_out.normalized().rotated(90) * width/2, "start right: ", start + start_out.normalized().rotated(-90) * width/2)
|
||||||
finish.width = 20
|
finish.width = 20
|
||||||
|
|
||||||
|
player.position = start
|
||||||
|
player.rotation = start_out.angle()
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
|
Loading…
Reference in a new issue