Projectile = Entity:createSubClass();

function Projectile:init()
   self:setForceUpdate(true);
   self:setBlockable(true);
   self.lifeTime = 32;
   self:setLayer(3);
end

function Projectile:update()
   
   self.lifeTime = self.lifeTime - 1;

   if self.lifeTime < 0 then
      self:die();
   end

end

function Projectile:collidedWithWorld()

   local explosion = Explosion:create();
   explosion:setPos(self:getPos());

   self:die();

end


Bullet = Projectile:createSubClass();
registerSpawn("Bullet");

function Bullet:init()

   Projectile.init(self);

   self:setTexture("oldsprites.tga");

   self:setSpriteScale(2);

   setSpriteFromDef(self, 10, 4);

end


