PhysX for DarkBASIC Professional

Example 6 : Particle Emitters

With the particle commands you can create your own emitters and customise them how you like, or use some prebuilt emitters. In this example a fire emitter is used. Emitters can be moved in real-time, allowing for effects such as impressive space ship plasma trails, or car exhausts.

` example of a fire emitter

` set up program properties

autocam off
sync on
sync rate 60
color backdrop 0
set ambient light 30
position camera 0, 50, -80
phy start

` make the fire emitter
phy make fire emitter 1, 512, 0, 20, 0
load image "fire.png", 1
texture object 1, 1
ghost object on 1, 0

` create background sphere
load image "stripe5.png",2
make object sphere 2,400,48,48
texture object 2,2
scale object texture 2,6,6
set object cull 2,0
set alpha mapping on 2, 80

` display Dark Physics logo
load image "logo.png", 100000
sprite 1, 0, 600 - 60, 100000

` main program loop
do
   ` rotate the background
   rotate object 2, 0, object angle y( 2 ) - 0.05, object angle z( 2 ) - 0.08

   ` update simulation and screen
   phy update
   sync
loop

Return to the Examples List

Dark Physics Atari forever :)

© Copyright 2006 The Game Creators Ltd. All Rights Reserved.
PhysX and associated imagery are trade marks of Aegia Technologies Inc, used with permission.