disable particles for now

This commit is contained in:
AJ Kelly
2011-08-23 09:18:02 -05:00
parent ed86859798
commit 336d6036f1
2 changed files with 46 additions and 44 deletions
@@ -15,56 +15,58 @@ local Params = {
File = "_particle normal",
};
local hideFancyElements = (GetUserPrefB("UserPrefFancyUIBG") == false)
local t = Def.ActorFrame{};
if hideFancyElements then return t; end
local tParticleInfo = {}
for i=1,Params.NumParticles do
tParticleInfo[i] = {
X = math.random(Params.VelocityXMin, Params.VelocityXMax),
Y = math.random(Params.VelocityYMin, Params.VelocityYMax),
Z = math.random(Params.VelocityZMin, Params.VelocityZMax),
Zoom = math.random(Params.ZoomMin*1000,Params.ZoomMax*1000) / 1000,
BobZRate = math.random(Params.BobRateZMin*1000,Params.BobRateZMax*1000) / 1000,
Age = 0,
};
t[#t+1] = LoadActor( Params.File )..{
Name="Particle"..i;
InitCommand=function(self)
self:basezoom(tParticleInfo[i].Zoom);
self:x(math.random(SCREEN_LEFT+(self:GetWidth()/2),SCREEN_RIGHT-(self:GetWidth()/2)));
self:y(math.random(SCREEN_TOP+(self:GetHeight()/2),SCREEN_BOTTOM-(self:GetHeight()/2)));
-- self:z(math.random(-64,0));
end;
OnCommand=cmd(diffuse,ColorLightTone(color("#ffd400"));diffusealpha,0.8);
};
tParticleInfo[i] = {
X = math.random(Params.VelocityXMin, Params.VelocityXMax),
Y = math.random(Params.VelocityYMin, Params.VelocityYMax),
Z = math.random(Params.VelocityZMin, Params.VelocityZMax),
Zoom = math.random(Params.ZoomMin*1000,Params.ZoomMax*1000) / 1000,
BobZRate = math.random(Params.BobRateZMin*1000,Params.BobRateZMax*1000) / 1000,
Age = 0,
};
t[#t+1] = LoadActor( Params.File )..{
Name="Particle"..i;
InitCommand=function(self)
self:basezoom(tParticleInfo[i].Zoom);
self:x(math.random(SCREEN_LEFT+(self:GetWidth()/2),SCREEN_RIGHT-(self:GetWidth()/2)));
self:y(math.random(SCREEN_TOP+(self:GetHeight()/2),SCREEN_BOTTOM-(self:GetHeight()/2)));
--self:z(math.random(-64,0));
end;
OnCommand=cmd(diffuse,ColorLightTone(color("#ffd400"));diffusealpha,0.8);
};
end
local function UpdateParticles(self,DeltaTime)
tParticles = self:GetChildren();
for i=1, Params.NumParticles do
local p = tParticles["Particle"..i];
local vX = tParticleInfo[i].X;
local vY = tParticleInfo[i].Y;
local vZ = tParticleInfo[i].Z;
tParticleInfo[i].Age = tParticleInfo[i].Age + DeltaTime;
p:x(p:GetX() + (vX * DeltaTime));
p:y(p:GetY() + (vY * DeltaTime));
p:z(p:GetZ() + (vZ * DeltaTime));
-- p:zoom( 1 + math.cos(
-- (tParticleInfo[i].Age * math.pi*2)
-- ) * 0.125 );
if p:GetX() > SCREEN_RIGHT + (p:GetWidth()/2 - p:GetZ()) then
p:x(SCREEN_LEFT - (p:GetWidth()/2));
elseif p:GetX() < SCREEN_LEFT - (p:GetWidth()/2 - p:GetZ()) then
p:x(SCREEN_RIGHT + (p:GetWidth()/2));
end
if p:GetY() > SCREEN_BOTTOM + (p:GetHeight()/2 - p:GetZ()) then
p:y(SCREEN_TOP - (p:GetHeight()/2));
elseif p:GetY() < SCREEN_TOP - (p:GetHeight()/2 - p:GetZ()) then
p:y(SCREEN_BOTTOM + (p:GetHeight()/2));
end
end;
tParticles = self:GetChildren();
for i=1, Params.NumParticles do
local p = tParticles["Particle"..i];
local vX = tParticleInfo[i].X;
local vY = tParticleInfo[i].Y;
local vZ = tParticleInfo[i].Z;
tParticleInfo[i].Age = tParticleInfo[i].Age + DeltaTime;
p:x(p:GetX() + (vX * DeltaTime));
p:y(p:GetY() + (vY * DeltaTime));
p:z(p:GetZ() + (vZ * DeltaTime));
-- p:zoom( 1 + math.cos(
-- (tParticleInfo[i].Age * math.pi*2)
-- ) * 0.125 );
if p:GetX() > SCREEN_RIGHT + (p:GetWidth()/2 - p:GetZ()) then
p:x(SCREEN_LEFT - (p:GetWidth()/2));
elseif p:GetX() < SCREEN_LEFT - (p:GetWidth()/2 - p:GetZ()) then
p:x(SCREEN_RIGHT + (p:GetWidth()/2));
end
if p:GetY() > SCREEN_BOTTOM + (p:GetHeight()/2 - p:GetZ()) then
p:y(SCREEN_TOP - (p:GetHeight()/2));
elseif p:GetY() < SCREEN_TOP - (p:GetHeight()/2 - p:GetZ()) then
p:y(SCREEN_BOTTOM + (p:GetHeight()/2));
end
end;
end;
t.InitCommand = cmd(fov,90;SetUpdateFunction,UpdateParticles);
@@ -1,5 +1,3 @@
local hideFancyElements = (GetUserPrefB("UserPrefFancyUIBG") == false)
local t = Def.ActorFrame {};
t[#t+1] = Def.ActorFrame {
@@ -15,9 +13,11 @@ t[#t+1] = Def.ActorFrame {
OnCommand=cmd(texcoordvelocity,0.125,0.5;diffuse,color("#ffd400");diffusealpha,0.045;bob;effectmagnitude,0,0,35;effectperiod,4);
};
};
--[[
LoadActor("_particleLoader") .. {
InitCommand=cmd(x,-SCREEN_CENTER_X;y,-SCREEN_CENTER_Y;hide_if,hideFancyElements;);
};
--]]
--[[ LoadActor("_particles") .. {
InitCommand=cmd(x,-SCREEN_CENTER_X;y,-SCREEN_CENTER_Y);
}; --]]