to give a bullet a flag just have a field in bullet called say 'firing_ship' which can be set to 0 for red, 1 for blue, say. If red bullets can't collide with the red ship, it would be faster to have separate type for red bullet,blue bullet and you only need to check for collisions between these and the opposing ship.