import pygamesys from pygame locals import pygame init( fps frames per second setting fpsclock pygame time clock( set up the window displaysurf pygame display set_mode(( ) pygame display set_caption('animation' white ( catimg pygame image load('cat png' catx caty direction 'right while truethe main game loop displaysurf fill(white if direction ='right' catx + if catx = direction 'down elif direction ='down' caty + if caty = direction 'left elif direction ='left' catx - if catx = direction 'up elif direction ='up' caty - if caty = direction 'right displaysurf blit(catimg(catxcaty) for event in pygame event get() if event type =quit pygame quit( sys exit( pygame display update(email questions to the authoral@inventwithpython com