function onCreate()
	Dodged = false;
    canDodge = false;
    DodgeTime = 0;
end

function onEvent(name, value1, value2)
    if name == "DodgeEvent" then
    DodgeTime = (value1);

    setPropertyFromClass('flixel.FlxG', 'mouse.visible', true)
    triggerEvent('Play Animation', 'appear', 'dad')

	canDodge = true;
	runTimer('Died', DodgeTime);
	
	end
end

function onUpdate()
   if canDodge == true and mousePressed('left') then
   
    Dodged = true;
    characterPlayAnim('boyfriend', '1', true);
    setProperty('boyfriend.specialAnim', true);
    triggerEvent('Play Animation', 'leave', 'dad')
    canDodge = false
    end
end

function onTimerCompleted(tag, loops, loopsLeft)
   if tag == 'Died' and Dodged == false then
   setProperty('health', 0);
   
   elseif tag == 'Died' and Dodged == true then
   Dodged = false
   
   end
end