PhysicsEntity: added a hit-reporting mechanism (for bullet animations)

This commit is contained in:
Erkki Seppälä 2014-10-19 04:48:45 +03:00
parent 47b2e741d8
commit f80337e1a5
2 changed files with 7 additions and 0 deletions

View file

@ -62,6 +62,10 @@ PhysicsEntity = Class{
Entity.delete(self)
end;
-- Reimplement
wasHit = function(self)
end;
-- Apply linear impulse with given direction and power
punch = function(self, angle, power)

View file

@ -153,6 +153,9 @@ function begin_contact(a, b, coll)
bObj:setPowerUpMode(ChaingunMode())
coll:setEnabled(false)
else
aObj:wasHit()
bObj:wasHit()
local plane = nil
local other = nil
if aObj:isinstance(Plane) then