09. Particle Effect
In this chapter, we will add particle effect to note hit segment.
Declaring
As before, declare the particle effect to be used:
export const particle = defineParticle({
effects: {
note: ParticleEffectName.NoteCircularTapCyan,
},
})
export const particle = defineParticle({
effects: {
note: ParticleEffectName.NoteCircularTapCyan,
},
})
Hit Segment
Let's add the particle effect to hit segment:
export const noteHit = {
enter() {
// ...
const layout = Rect.one
.mul(2 * note.radius)
.scale(1, -1)
.translate(0, 1)
particle.effects.note.spawn(layout, 0.3, false)
},
}
export const noteHit = {
enter() {
// ...
const layout = Rect.one
.mul(2 * note.radius)
.scale(1, -1)
.translate(0, 1)
particle.effects.note.spawn(layout, 0.3, false)
},
}