Вот как-то так у меня получилось:
import pygame
pygame.init()
screen=pygame.display.set_mode([700,500])
pygame.display.set_caption("Rainbow!!")
done=False
clock=pygame.time.Clock()
#Wave offset
offset = 2
#Segment
sWidth = 40
sHeight = 15
#Start
sx = 50
sy = 200
width = 11
#Rainbow!!
bg = (0,51,102)
rainbow = [(255,0,0),(255,153,0),(255,255,0),(51,255,0),(0,153,255),(102,51,255)]
# -------- Main Program Loop -----------
while done==False:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done=True
# Nyan-cat background
screen.fill(bg)
for i in range(0,width):
offset = -offset
for j in range(0,5):
pygame.draw.rect(screen,rainbow[j],[sx+i*sWidth,sy+sHeight*j+offset,sWidth,sHeight])
clock.tick(8)
pygame.display.flip()
pygame.quit()