fix collide_rect to work with arrays