Menu
CoddyTech

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 = true

The robot's Burst node also has explosiveness = 1.0. All its particles come out in the same instant instead of one after another.

challenge icon

Challenge

Easy

Make the robot spark when you press E:

  1. in _ready, make $Burst one shot,
  2. in _process, when "action" is just pressed, set the Burst's emitting to true.

Try it yourself

extends Node2D

func _ready():
	$Thruster.emitting = true

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 Game Feel

Practice on your own: Godot playground