Menu
CoddyTech

Screensaver: Drift

Part of the Nodes and Scenes section of Coddy's Godot journey. Lesson 24 of 27.

In the next four lessons you build a screensaver: a logo that drifts around the screen, bounces off the edges and changes color on every bounce.

The scene has a dark sky and a Logo node with a white plate, a shadow and a Label. The logo's modulate tints the plate blue. Its script, logo.gd, does nothing yet.

The first step is a velocity. Keep it in a node variable, so later steps can change it when the logo bounces.

challenge icon

Challenge

Easy
  • Add a node variable velocity, set to Vector2(200, 90).
  • Move the logo by velocity on every frame, per second. It drifts down and to the right, and off the screen for now.

Try it yourself

extends Node2D

func _process(delta):
	pass
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Nodes and Scenes

Practice on your own: Godot playground