Making a top down car racer in Godot
Introducing variables This section is work in progress Rotating the direction vector Option 1: Calculating it from an angle Option 2: Maybe faster Needs to be normalized perpendicular vector work in progress Full code Car.gd extends KinematicBody2D const max_speed_forward = 40000 const max_speed_backwards = 15000 const accel = 0.5 const deaccel = 0.4 const deaccel_break = 0.7 var current_direction = Vector2(0, -1) var rotation_speed = 5 var current_speed = 0 var current_turn = 0 func perpendicular_vector(vec: Vector2): return Vector2(vec....