Create a new scene with CPUParticles2D as root
To create the look of the explosion - play with these values
Set Gravity to 0
(Since we are in space)
Set the Min and Max velocity
I found these values look good
Add a script to the Particles node
Connect the finished signal
Code it to destroy the particles
Return to the Asteroid script
Add a reference to the Particle scene
Assign the scene in the Inspector
Create a function to spawn and explosion
If the scene was not assigned => exit
Add it to the current scene tree
Position it at the asteroid
Match the size of the asteroid
Create a function to destroy the asteroid
Test the game, asteroids should explode when the ship collides with them and the ship should disappear