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....

March 31, 2021 · 2 min · Me

How to: Godot parallax backgrounds

What is a parallax background? Parallax is a effect you can use for your background in your 2D platformer game. You can make layers of background images, each of them can scroll in a different speed. That creates a nice illusion of depth. Take a look at this video: Sorry, your browser doesn't support embedded videos. As you can see, we have drawn several layers of background in our game Vagos Dream, and then used the godot ParallaxBackground node to handle the scrolling....

February 27, 2021 · 3 min · Me