playground:particle
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes | ||
playground:particle [2017/05/11 17:31] – falsam | playground:particle [2017/05/28 17:15] – falsam | ||
---|---|---|---|
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 | ||
+ | </ | ||
playground/particle.txt · Dernière modification : 2023/03/15 15:49 de 127.0.0.1