This is how i detected collision between two sprites using CCRect function.