if(helicopter.u==216) { if(PAD1R2) { gunmove++; if(gunmove>90) { gunmove=90; } } if(PAD1L2) { gunmove--; if(gunmove<2) { gunmove=2; } } gunangle=gunmove/2; for(a=0;a<10;a++) { if(groundlines[currentline+a].angle==90) { shoty=groundlines[currentline+a].y; shotx=(((stan[gunangle]*(shoty-helicopter.y))>>12)+160); if(shotx>=(groundlines[currentline+a].x-landbg.scrollx) && shotx<=(groundlines[currentline+a].x1-landbg.scrollx)) { break; } } else { shotx=(groundlines[currentline+a].x-landbg.scrollx); shoty=((((shotx-160)<<12)/stan[gunangle])+helicopter.y); if(shoty>=groundlines[currentline+a].y1 && shoty<=groundlines[currentline+a].y) { break; } } } } if(helicopter.u==0) { if(PAD1R2) { gunmove--; if(gunmove<2) { gunmove=2; } } if(PAD1L2) { gunmove++; if(gunmove>90) { gunmove=90; } } gunangle=gunmove/2; for(a=0;a<10;a++) { if(groundlines[currentline-a].angle==90) { shoty=groundlines[currentline-a].y; shotx=(160-((stan[gunangle]*(groundlines[currentline-a].y-helicopter.y))>>12)); if(shotx>=(groundlines[currentline-a].x-landbg.scrollx) && shotx<=(groundlines[currentline-a].x1-landbg.scrollx)) { break; } } else { shotx=(groundlines[currentline-a].x-landbg.scrollx); shoty=((((160-(groundlines[currentline-a].x-landbg.scrollx))<<12)/stan[gunangle])+helicopter.y); if(shoty>=groundlines[currentline-a].y1 && shoty<=groundlines[currentline-a].y) { break; } } } }