//////////////
// PARTICLE //
//////////////
particle
parent_type = /obj
// -- var -- //
var
position_x = 0.00
position_y = 0.00
life = 45
life_max = 45
velo_x = 0.00
velo_y = 0.00
New(X,Y,VX,VY)
..()
loc = locate(1,1,1)
icon = _picon
SetPosition(X,Y)
SetVelocity(VX,VY)
proc
Update()
velo_x = velo_x * 0.95
velo_y = velo_y + 0.125
MovePosition(velo_x, velo_y)
life--
if (life <= 0)
del src
else
color = rgb( 127 + (128 * (life/life_max)), (255 * (life/life_max)), 0)
var/matrix/m = matrix()
m.Turn(life*4)
m.Scale((life/life_max)+0.25,(life/life_max)+0.25)
transform = m
SetPosition(X,Y)
if (X != null) position_x = X
if (Y != null) position_y = Y
UpdatePixelCoords()
MovePosition(X,Y)
if (X != null) position_x += X
if (Y != null) position_y += Y
UpdatePixelCoords()
UpdatePixelCoords()
pixel_x = round(position_x)
pixel_y = round(position_y)
SetVelocity(X,Y)
if (X != null) velo_x = X
if (Y != null) velo_y = Y
AddVelocity(X,Y)
if (X != null) velo_x += X
if (Y != null) velo_y += Y
/////////
// VAR //
/////////
var
list/
_list_particles = new/list()
icon/
_picon
proc
_Init()
_picon = icon('icons20.dmi',"white")
_Update()
for (var/d = 1 to 10)
var/u = rand(0,320)
var/e = rand(-10,10)
var/f = rand(0,2)
_list_particles += new/particle(u,-10,e,f)
for (var/particle/d in _list_particles)
d.Update()
world
fps = 30
icon_size = 20
New()
..()
_Init()
spawn()
while(TRUE)
_Update()
sleep(world.tick_lag)

But I think these examples would be a lot more useful with accompanying source code snippets.