def Explode(obj,objlist): pieces=quarter(obj.image,2) for x in ((1,0),(2,1),(-1,2),(-2,3)): piece = ExplosionPiece(objlist,pieces[x[1]],obj.rect.center) piece.deltax*=x[0] objlist.add(piece)def quarter(image,size): pieces=[] imgrect=image.get_rect() imgrect.width=imgrect.width/size imgrect.height=imgrect.height/size for x in range(size): for y in range(size): imgrect.left=imgrect.width *x imgrect.top =imgrect.height*y img = pygame.Surface(imgrect.size) globalvars.normalize_img(img) img.blit(image,imgrect) pieces.append(img) return pieces