Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- window = pygame.display.set_mode((600, 600))
- pygame.display.set_caption("ASSHOLE!")
- screen = pygame.Surface((600, 600))
- screen.fill((50,50,50))
- class Sprite:
- def __init__(self, xpos, ypos, filename):
- self.x=xpos
- self.y=ypos
- self.bitmap=pygame.image.load(filename)
- self.bitmap.set_colorkey((0,0,0))
- def render(self):
- screen.blit(self.bitmap, (self.x,self.y))
- laser = Sprite(0, 0, 'laser.png')
- done = True
- while done:
- for e in pygame.event.get():
- if e.type == pygame.QUIT:
- done = False
- screen.fill((50,50,50))
- laser.render()
- window.blit(screen, (0,0))
- window.blit(screen, (0, 0))
- pygame.display.flip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement