Godot 4 Snippet: Top-Down Golf Ball

This code snippet enables a button to hit a 2D golf ball in a direction opposite the cursor. The code assumes a top-down view of the ball.

Godot 4 Tutorial: Raycast2D Laser

The Raycast2D node can be combined with the Line2D node to create a laser that sweeps a room and can be occluded by other objects. Raycasts are particularly useful for shooters and stealth games.

You can make a moving tiled background in Godot 4 using a single TextureRect and a shader instead of multiple sprites. I learned how to create this effect from a Reddit comment and adapted it to make the scrolling effect controlled via scripting. This approach is well-suited for background elements and also has the bonus of being size-independent.