phinnycupcakes
12-25-2008, 06:04 AM
So I want to add a recently hit function that basically gives you invincibility for 2 seconds after you get hit.
I've got a recentlyHit boolean in my char's class, and implementation so far works perfectly
this is what i have so far... definitely not much
function charHit ()
{
if(recentlyHit)
{
_root.char._alpha = 50;
// WAIT 2 SECONDS
recentlyHit = false;
}
}
So... guess what I want =P
I was thinking of maybe using setInterval,
but this method is in an onEnterFrame part for my playercharacter movieclip. And yeah, I want to be able to move still, I just want a timer going in the background that sets off when you get hit.. Thats all.
shouldn't be too difficult.
I've got a recentlyHit boolean in my char's class, and implementation so far works perfectly
this is what i have so far... definitely not much
function charHit ()
{
if(recentlyHit)
{
_root.char._alpha = 50;
// WAIT 2 SECONDS
recentlyHit = false;
}
}
So... guess what I want =P
I was thinking of maybe using setInterval,
but this method is in an onEnterFrame part for my playercharacter movieclip. And yeah, I want to be able to move still, I just want a timer going in the background that sets off when you get hit.. Thats all.
shouldn't be too difficult.