"Thunder"
Init:
thunderReset();
float x,z;
vector a,b;
# 12 thunderbolts
for (n=0;n<12;n++)
{
x=rand(100)-50;
z=rand(100)-50;
if (rand(100)>50)
{
if (x<0) x-=50;
if (x>0) x+=50;
}
else
{
if (z<0) z-=50;
if (z>0) z+=50;
}
a.Init(x,6.0,z);
b.Init(x,-40.0,z);
thunderNew(a,b,7); # texture (7)
}
for (n=0;n<12;n++)
{
thunderSetAlpha(n,floatrand());
}
Play:
thunderSet(n,a,b,7); # new position
thunderSetAlpha(n,alpha); # new alpha value