-, . - . suburface(), blitting, "" , . : , , . 8 , FPS: - 12 ( 1/12 ), 1/3 fps = 4 fps ( 3/12 ) 1/12 fps = 1 fps (12/12 = 1 ). script, , , script.
script:

Source:
import pygame, os
from pygame.locals import *
def Cycle(n, N) :
value = n+1
case1 = (value >= N)
case2 = (value < N)
result = case1 * 0 + case2 * value
return result
w = 600
h = 400
cdir = os.path.curdir
states = 8
pygame.init()
DISP = pygame.display.set_mode((w, h))
BG = (36, 0, 36)
DISP.fill(BG)
band_1 = pygame.image.load(os.path.join(cdir, "band1.png")).convert()
K = 4
band_1 = pygame.transform.scale(band_1, (K * band_1.get_width(), K * band_1.get_height()))
band_1.set_colorkey((0,0,0))
sw = K*8
sh = K*8
r0 = (100, 100, sw, sh)
r1 = (150, 100, sw, sh)
r2 = (200, 100, sw, sh)
s0 = 0
s1 = 0
s2 = 0
t0 = 1
t1 = 1
t2 = 1
Loop_1 = True
FPS = 12
clock = pygame.time.Clock( )
while Loop_1 :
clock.tick(FPS)
DISP.fill(BG, r0)
sprite_0 = band_1.subsurface((s0*sw, 0, sw, sh))
DISP.blit(sprite_0, r0)
s0 = Cycle(s0, states)
if t1 == 3 :
DISP.fill(BG, r1)
sprite_1 = band_1.subsurface((s1*sw, 0, sw, sh))
DISP.blit(sprite_1, r1)
s1 = Cycle(s1, states)
t1 = 0
if t2 == 12 :
DISP.fill(BG, r2)
sprite_2 = band_1.subsurface((s2*sw, 0, sw, sh))
DISP.blit(sprite_2, r2)
s2 = Cycle(s2, states)
t2 = 0
for event in pygame.event.get( ):
if event.type == QUIT : Loop_1 = False
if event.type == KEYDOWN:
if event.key == K_ESCAPE : Loop_1 = False
t1 = t1 + 1
t2 = t2 + 1
pygame.display.update()
pygame.quit( )