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
Easy- Add a node variable
velocity, set toVector2(200, 90). - Move the logo by
velocityon 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
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Nodes and Scenes
1Your First Godot Game
What Is Godot?Ready Runs OncePrint in GodotThe Scene TreeSet a PositionMove a Node Once2Every Frame
Process Runs Every FrameDeltaPixels per SecondMove DiagonallySpin With RotationGrow With Scale5Project: Screensaver
Screensaver: DriftScreensaver: Side WallsPractice on your own: Godot playground