I know that the hand cannon knocks the party back one square (knockback = true,). What I am trying to do with the (below object) is when it's destroyed the party is knocked back. I really don't have a clue how to do this and was wondering if someone could help me with the code please.
Thank you foe the help on this.
Code: Select all
defineObject {
name = "barrel_block_exploding",
baseObject = "my_barrel_crate_block",
tags = { "my_stuff_break" },
components = {
{
class = "Health",
health = 30,
spawnOnDeath = "barrel_crate_block_broken",
onDie = function(c)
hudPrint("Well that was a dumb idea destroying the barrel.")
local i, j;
for i = -1, 1 do
for j = -1, 1 do
if i ~= 0 or j ~= 0 then
spawn("fireball_large", c.go.level, c.go.x + i, c.go.y + j, 0, c.go.elevation)
end
end
end
end
}
}
}