var count:int=0; public function update():void { if(count&1) bulletsandaliens(); else heroandaliens(); count++ }
Thanks for explaining the logic of this technique for performance.
&1 will return true then false alternatating everytime the update function is called. So one time is will call one of the sub functions then next time it will call the other
Its basically a check see if count is an odd number using the bitwise and (&) operator
orcuncun
bwhiting So, the bw part of your name stands for bitwise I guess? 😉