I have to recreate digging.
What should happen is: digging, fade-out, a black screen for a very short time, fade in - having a dighole if there was nothing or my specials. Everything like normal digging...
But it won't work
Has someone an idea?
I have placed 2 timers on my map that triggers after 0.5sec the events for "found nothing" and "found it". I am trying to start one of this timers by the following code, attached to the shovel-definition:
Code: Select all
onAttack = function (champion, self)
-- define locals
local dx,dy = 0,0
-- get position modificators, to find cell in front of the party
if party.facing == 0 then dy = -1
elseif party.facing == 1 then dx = 1
elseif party.facing == 2 then dy = 1
elseif party.facing == 3 then dx = -1
end
-- check what is in front of the party
local checkedCell = entitiesAt(party.level, party.x + dx, party.y + dy)
-- interate through all objects on cell
for object in checkedCell do
if object.id == "invisible_platform_diggout" then
playSound("party_dig")
hudPrint("Digging...")
GameMode.fadeOut(0x0,1.5)
timer_digOut.timer:enable()
else
playSound("party_dig")
hudPrint("Digging...")
GameMode.fadeOut(0x0,1.5)
timer_foundNothing.timer:enable()
spawn("dig_hole", party.level, party.x + dx, party.y + dy, 0, party.elevation)
end
end
end,