I've looked around, and I don't see anyone else asking these questions so I'll ask them here. Please try to answer my questions in the simplest form that you can. There will be multiple questions. And a attempt to make things easier, I'll post 1/2 of the script & function here, and ask questions below it.
In trying to make my questions clear and less missunderstood, I bolded the questions... So I hope there won't be no missunderstandings.
PHP Code:
function onTimeout(){
temp.x = (player.x + vecx(player.dir) * 1.5) + this.origins(player.dir[0]);
temp.y = (player.y + vecy(player.dir) * 4) + this.origins(player.dir[1]);
temp.angle = (pi / 2) * (player.dir + 1 );
for(temp.i = 0; i < this.bullets i ++)
shoot(x, y, z, angle + random((- this.spray), this.spray));
}
As some of you probably have obviously noticed already, theres quite a bit missing in the script. Note I have only left the portion of the script that I'm unsure of. And some pieces that possibly might help you answer my questions better.
Questions:
First off
can someone explain "for"? I thought I had a good grip on what it means but I'm not sure anymore.
Note: this.bullets is how many shots fired/taken away from the gun.
Just to save trouble for posting later.. I'll ask about these too.
Whats the
diffrence between player.x and vecx?
And most likely a dumb question but,
is random a event?
Not sure of its purpose but believe it to regulate the spread.
Last two questions...
And in temp.x ,
does(player.dir[1]) mean the first direction?
In (temp.angle = (pi / 2) * (player.dir + 1);
Also does
player.dir + 1 mean the first direction?
If not what do they mean?
thanks to whoever reads this and tries to help me for your time.