A One Shot Burst
Part of the Game Feel section of Coddy's Godot journey. Lesson 13 of 23.
The Thruster never stops. When a particle dies, a new one replaces it. A spark or an explosion happens once and ends.
one_shot = true makes a CPUParticles2D throw out its particles once, then stop. emitting turns back to false when the last particle dies. Set it to true again to fire another round.
$Burst.one_shot = true
$Burst.emitting = trueThe robot's Burst node also has explosiveness = 1.0. All its particles come out in the same instant instead of one after another.
Challenge
EasyMake the robot spark when you press E:
- in
_ready, make$Burstone shot, - in
_process, when"action"is just pressed, set the Burst'semittingtotrue.
Try it yourself
extends Node2D
func _ready():
$Thruster.emitting = true
func _process(delta):
pass
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Game Feel
Practice on your own: Godot playground