Recharge powers

Posted By: Anonymous

Recharge powers - 02/28/01 02:42

I want to have this effect..
When I press a key it allows the player to use a certain ability. Now I want the power to only last for a certain amount of time which is based on a meter panel that the player can see. When your meter reaches zero you will not be able to use that power until the meter recharges. Also if you press the key again before your meter reaches zero then your power will begin to recharge from where you stopped using it. I can make it work so far just by using a WAIT command. But I can always use it. I want to limit the use of it. How can I link it to a meter? GS out.
Posted By: Anonymous

Re: Recharge powers - 02/28/01 05:22

Try this:

var power = 0;

while (power < 100)
{
//do your stuff;
power += TIME;
....
}

Posted By: Anonymous

Re: Recharge powers - 02/28/01 06:17

OK I see what your saying but how can I make the meter panel respond when I press the key that activates the power. Press key, activates power,then the meter starts to decrease. When meter reaches zero,the power cannot be used. Player must wait until the meter recharges to at least 15%. Please help.
GS out.
Posted By: Anonymous

Re: Recharge powers - 02/28/01 06:38

Nevermind about the last post I got the meter to decrease. Now how do I tell the meter once it reaches a certain point to slowly recharge? GS out.
Posted By: Anonymous

Re: Recharge powers - 03/01/01 04:25

Anyone!?!?! ..... Please help!!!!! GS out.
Posted By: Anonymous

Re: Recharge powers - 03/01/01 04:29

Simply extend the script a little , something like this:

var power = 0;
var pwrdown = 0;

while (power < 100)&& (pwrdown == 0)
{
//do your stuff;
power += TIME;
....
}else
{
//do your stuff;
pwrdown=1;
power -= time*0.25;
}

Hope it helps

Trash

------------------
program (pro'-gram) A magic spell cast over a computer allowing it to turn input into error messages.

Posted By: Anonymous

Re: Recharge powers - 03/02/01 06:30

help!!!!

[This message has been edited by Gamesaint7 (edited 02 March 2001).]

Posted By: Anonymous

Re: Recharge powers - 03/02/01 07:54

Ok I fixed the problem!!!!! I have seen the light baby!! Now I have this ability on a limited basis. I have also implemented a power up so you can keep on rockin you cant recharge anymore. Of course those will be hard to come by. I love this programming stuff!!!!!!!!!!! GS out.
© 2024 lite-C Forums