Djinn wrote:
So if I wanted to have multiple different occassions of gibs being added all I would have to do is add some elseif self.frame = x and add them through that. The only other thing I'd have to do is create more local variables for the gibs, correct?
Yup
Oh and a small thing
add this around the script
if ((self.Pos.Y > 0 and self.Pos.Y < SceneMan.SceneHeight) or SceneMan.SceneWrapsY) and ((self.Pos.X > 0 and self.Pos.X < SceneMan.SceneWidth) or SceneMan.SceneWrapsX) then
end
so it looks like this
Code:
function Destroy(self)
if ((self.Pos.Y > 0 and self.Pos.Y < SceneMan.SceneHeight) or SceneMan.SceneWrapsY) and ((self.Pos.X > 0 and self.Pos.X < SceneMan.SceneWidth) or SceneMan.SceneWrapsX) then
if self.Frame == whateverFrame then
--Repeat for each gib
local Gib = CreateMOSRotating("Your gib");
Gib.Pos = self.Pos + self:RotateOffset(Vector(X-offset, Y-offset));
Gib.Vel = self.Vel + Vector(math.random(-maxspeed,maxspeed),math.random(-maxspeed,maxspeed));
Gib.RotAngle = self.RotAngle;
Gib.AngularVel = self.AngularVel + math.random(-maxAngularVel,maxAngularVel);
Gib.HFlipped = self.HFlipped;
MovableMan:AddParticle(Gib);
end
end
end