Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame, functions
- from pygame.locals import *
- RESOLUTION = (256, 240)
- SCALE = 2
- class Player(pygame.sprite.Sprite):
- def __init__(self):
- pygame.sprite.Sprite.__init__(self)
- self.image, self.rect = functions.load_image('player.bmp')
- self.rect.center = ([x/2 for x in RESOLUTION])
- pygame.init()
- clock = pygame.time.Clock()
- screen = pygame.display.set_mode((
- int(RESOLUTION[0]*SCALE),
- int(RESOLUTION[1]*SCALE)))
- surface = pygame.Surface(RESOLUTION)
- surface = pygame.transform.scale(surface,
- (int(RESOLUTION[0]*SCALE),
- int(RESOLUTION[1]*SCALE)))
- screen.blit(surface, (0, 0))
- sprites = pygame.sprite.RenderPlain(Player())
- while True:
- clock.tick(60)
- sprites.update()
- sprites.draw(surface)
- pygame.display.flip()
Add Comment
Please, Sign In to add comment