At 7/19/06 03:53 PM, Darkfire_Blaze wrote:
At 7/19/06 03:51 PM, Darkfire_Blaze wrote:
I was thinking on something similar. But if I make any key, the player will be able to charge while he shoots. The thing is, i want it to, so that if he shoots
grr.
The thing is, I want it to, so that if he shoots, after the shooting sound, the beam begins to charge. And if he releases the click, it will fire itself.
Sorry for double post but, my brother clicked the post it thing while i was typing. D:
Ah, so you want to make it based off of the mouse click.
Here's what I've done in the past for that situation:
onMouseDown=function()
{
var mdown=true;
}
onMouseUp=function()
{
mdown=false;
}
//so you can then do
var mycounter=0;
if (mdown)
{
//1 bullet shooting code or function
mycounter+=1;
}
else
{
if (mycounter>1)
{
//run the charge blast based on the counter
mycounter=0;
}
}
//I haven't tested it, but you get the general idea