I have tried to use box1.collidingwith(box2) but this made the game meet the condition once I run the code
Code:
ball=0
def task1():
global ball
while ball <4:
action=box1.collidingwith(box2)
yield viztask.waitEvent(action)
ball +=1
print 'Number of Balls is : ',ball