35 lines
714 B
Lua
35 lines
714 B
Lua
|
Class = require 'hump.class'
|
||
|
require 'entities/physicsentity'
|
||
|
require 'settings'
|
||
|
|
||
|
Vickers77 = Class{
|
||
|
__includes = Rectangle,
|
||
|
|
||
|
MAX_LIFETIME = 60 * 5,
|
||
|
img = nil,
|
||
|
frame = 0,
|
||
|
|
||
|
init = function(self, x, y, level)
|
||
|
local xsize = 0.35 * PIXELS_PER_METER
|
||
|
local ysize = 0.1 * PIXELS_PER_METER
|
||
|
|
||
|
Rectangle.init(self, x, y, level, "dynamic", 0.2, xsize, ysize, 1000, nil)
|
||
|
self.body:setBullet(true)
|
||
|
end;
|
||
|
|
||
|
update = function(self, dt)
|
||
|
Rectangle.update(self, dt)
|
||
|
|
||
|
self.frame = self.frame + 1
|
||
|
|
||
|
if self.frame >= self.MAX_LIFETIME then
|
||
|
self:delete()
|
||
|
end
|
||
|
end;
|
||
|
|
||
|
draw = function(self)
|
||
|
Rectangle.draw(self)
|
||
|
end;
|
||
|
}
|
||
|
|