# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )# -*- coding: cp1251 -*-
# pygame.
from pygame import *
import sys
# .
init ( )
# 640480
screen = display. set_mode ( ( 640 , 480 ) )
#
display. set_caption ( 'example' )
# , :
# jpg, png, gif( ), bmp, pcx, tga( ), tif.
background = image. load ( 'background.bmp' )
#
screen. blit ( background, ( 0 , 0 ) )
#
class GameObj:
def __init__ ( self , img, x, y, step ) :
self . img = img #
self . x = x # x, y -
self . y = y
self . step = step # ,
self . pos = img. get_rect ( ) . move ( x, y )
def _move ( self , event ) :
if event. key == K_UP: #273
self . pos = self . pos . move ( 0 , - self . step )
if event. key == K_DOWN:
self . pos = self . pos . move ( 0 , self . step )
if event. key == 276 :
self . pos = self . pos . move ( - self . step , 0 )
if event. key == 275 :
self . pos = self . pos . move ( self . step , 0 )
avatar = image. load ( 'player.bmp' )
#
x = GameObj ( avatar, 320 , 220 , 10 )
# ,
screen. blit ( x. img , x. pos )
# , :)
while 1 :
for i in event. get ( ) : #
if i. type == QUIT: #
sys . exit ( )
if i. type == KEYDOWN:
screen. blit ( background, x. pos , x. pos )
x._move ( i )
screen. blit ( x. img , x. pos )
# ,
display. flip ( )
Source: https://habr.com/ru/post/56255/
All Articles