Ranging from dust kicked up by an out of control race car spinning out into a run-off area over smoke that ascends from a battlefield to sparks spraying from a magic wand, particles are a great tool for adding life and visual fidelity to the graphics of a game. Therefore, this recipe will show you how to create a simple particle effect.
This recipe is based upon the project setup presented in Setting up the game structure. Please follow this recipe, found in Chapter 1, before proceeding.
Let's try the following Panda3D's particle effect system:
Open the file
Application.py
and add the following code:from direct.showbase.ShowBase import ShowBase from panda3d.core import * from direct.particles.Particles import Particles from direct.particles.ParticleEffect import ParticleEffect class Application(ShowBase): def __init__(self): ShowBase.__init__(self) self.enableParticles() particles = Particles() particles...