From 8f9ad6f87c24e67f9296c6c91bc4eb07f70f3a58 Mon Sep 17 00:00:00 2001 From: KingGurke Date: Sun, 1 Oct 2023 13:27:43 +0200 Subject: [PATCH] Made the player teleport and rotate exactly to starting position when the level is started --- src/game/hud_controller.gd | 2 +- src/game/level.gd | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/game/hud_controller.gd b/src/game/hud_controller.gd index 15264f8..74e95b4 100644 --- a/src/game/hud_controller.gd +++ b/src/game/hud_controller.gd @@ -7,7 +7,7 @@ extends Control func _on_player_speed_changed(speed_float: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) func _on_level_distance_changed(distance_float): diff --git a/src/game/level.gd b/src/game/level.gd index 2242594..6a0819b 100644 --- a/src/game/level.gd +++ b/src/game/level.gd @@ -47,6 +47,9 @@ func _ready(): 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) finish.width = 20 + + player.position = start + player.rotation = start_out.angle() # Called every frame. 'delta' is the elapsed time since the previous frame.