in my tile game the bullets detection is wrong
i use the mouse to get the direction for the bullets
but they wont go all the way
here is some code
Code:int pos(int x, int y) { return level[(y/TILE_SIZE)][(x/TILE_SIZE)%MAPSIZE]; } //main() if(mouse_b & 1&&!fired) { fired=1; bulletx=240; bullety=240; skottang = atan2( ( ( 240 ) - ( mouse_y ) ) , ( ( 240 ) - ( mouse_x ) ) ); //240 =centerscreen } if(fired) { bulletx-=5 *cos(skottang); bullety-=5 *sin(skottang); } if(pos(bulletx,bullety)==1) { fired = 0; }