Particles
Part of the Game Feel section of Coddy's Godot journey. Lesson 12 of 23.
Smoke, sparks, flames and dust are made of particles. A particle node throws out many small shapes, moves each one for a while and then removes it.
The node is CPUParticles2D. The robot has one under its feet called Thruster, set up to throw amber flames downward. It starts switched off.
$Thruster.emitting = trueemitting switches it on and off. A few other properties shape the effect:
amount: how many particles are alive at oncelifetime: how many seconds each one livesdirectionandspread: where they flygravity: what pulls them
Challenge
EasyGive the robot a thicker flame.
- In
_ready(), set$Thruster.emittingtotrue. - Set
$Thruster.amountto40.
Press Play: flame pours from under the robot. Then Check.
Try it yourself
extends Node2D
func _ready():
pass
All lessons in Game Feel
Practice on your own: Godot playground