Hi all.
At first, I wanna say, that I'm not a professional game developer or even programmer, so my question could be very, very dumb.
I'm making some kind of a prototype of an arcade arena shooter (a bit lika a Geometry Wars clone
), and my problem is shooting.
I need fire to be full auto (binded on the left mouse button) with a rate of fire 2 bullets in a second.
So my Input section is like:
Code:
if(Ms.b(0) && Time.curTime()-lastB>0.5)
{
lastB=Time.curTime();
//checking free bullet obj
for (int i=0; i<300; i++)
//free?
if (!Bl[i].Check())
{
//givin params to bullets, not so important
Vec2 temp;
temp = -Getpos()+Ms.pos();
float =sqrt(temp.x*temp.x+temp.y*temp.y);
temp.x/=g;
temp.y/=g;
Bl[i].Set(Getpos(), temp);
break;
}
}
So, as you can see, I use Ms.b(0) event and I check if the differenct between current time in seconds and time of last shot is more then 0.5 seconds.
Completly doesn't work. It is shooting >9000 bullets in a second :(
What I am doing wrong?
P.S. Sory for my poor english