Smoke = Entity:createSubClass();

function Smoke:init()

   self:setTexture("shmup1.tga");
   self:setGravityInfluence(0);
   self:setSpriteFrame(0, 64, 32, 96);

   self.animFrame = 0;

   self:setBlockable(false);
   self:setLayer(4);

end

function Smoke:update()

   local animSpeed = 0.25;

   self.animFrame = self.animFrame + animSpeed;

   if self.animFrame >= 5 then
	  self:die();
   end

   local realFrame = math.floor(self.animFrame) * 32;

   self:setSpriteFrame(realFrame, 64, realFrame + 32, 96);

end

function addSmoke(x, y, dx, dy)
   
   local smoke = Smoke:create();

   smoke:setPos(x, y);
   smoke:setVel(dx, dy);

end
