playground:particle
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| playground:particle [2017/05/11 17:26] – créée falsam | playground:particle [2023/03/15 15:49] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | **13-Particle.sb** | ||
| + | |||
| + | [[http:// | ||
| + | |||
| + | <file purebasic | ||
| + | ; | ||
| + | |||
| + | EnableExplicit | ||
| + | |||
| + | IncludeFile " | ||
| + | |||
| + | Global Scene, Camera, Box, Emitter, Material | ||
| + | |||
| + | Declare LoadGame() | ||
| + | Declare RenderGame() | ||
| + | |||
| + | UseModule BJS | ||
| + | |||
| + | InitEngine(@LoadGame()) | ||
| + | |||
| + | Procedure LoadGame() | ||
| + | Scene = CreateScene() | ||
| + | If Scene | ||
| + | CreateCamera(" | ||
| + | CreateLight(" | ||
| + | | ||
| + | ;The particle system will be attached to a mesh | ||
| + | Box = CreateBox(" | ||
| + | | ||
| + | ;Create a particle system and attach it to a mesh. | ||
| + | Emitter = CreateParticleEmitter(" | ||
| + | | ||
| + | ;Texture of each particle | ||
| + | ParticleTexture(Emitter, | ||
| + | | ||
| + | ;Where the particles come from | ||
| + | ParticleEmitBox(Emitter, | ||
| + | | ||
| + | ;Colors of all particles | ||
| + | ParticleColor(Emitter, | ||
| + | ParticleColorDead(Emitter, | ||
| + | |||
| + | ;Size of each particle (random between...) | ||
| + | ParticleSizeRange(Emitter, | ||
| + | |||
| + | ;Life time of each particle (random between... | ||
| + | ParticleTimeToLive(Emitter, | ||
| + | |||
| + | ;Emission rate | ||
| + | ParticleEmissionRate(Emitter, | ||
| + | |||
| + | ;Set the gravity of all particles | ||
| + | ParticleGravity(Emitter, | ||
| + | |||
| + | ;Direction of each particle after it has been emitted | ||
| + | ParticleDirection(Emitter, | ||
| + | | ||
| + | ;Angular speed | ||
| + | ParticleAngularSpeed(Emitter, | ||
| + | |||
| + | ;Speed | ||
| + | ParticleSpeed(Emitter, | ||
| + | |||
| + | ;Start the particle system | ||
| + | StartParticle(Emitter) | ||
| + | | ||
| + | RenderLoop(@RenderGame()) | ||
| + | EndIf | ||
| + | EndProcedure | ||
| + | |||
| + | Procedure RenderGame() | ||
| + | RotateMesh(Box, | ||
| + | RenderWorld() | ||
| + | EndProcedure | ||
| + | </ | ||
