1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
attack-on-blocks/player.py

25 lines
705 B
Python
Raw Normal View History

2015-04-16 10:00:39 +01:00
import pygame
class Shooter(pygame.sprite.Sprite):
2015-04-29 09:48:37 +01:00
def __init__(self, window, color=(30,0,150), width=50, height=25):
2015-04-16 10:00:39 +01:00
super().__init__()
2015-04-29 09:48:37 +01:00
self.width = width
self.height = height
2015-04-16 10:00:39 +01:00
self.image = pygame.Surface((width, height))
self.image.fill(color)
self.rect = self.image.get_rect()
self.speed = 3
2015-04-29 09:48:37 +01:00
self.window_rect = window.get_rect()
self.score = 0
self.OP = True
self.level = 0
self.lives = 3
2015-05-07 22:12:33 +01:00
self.powerup = ""
2015-04-16 10:00:39 +01:00
def set_position(self,x,y):
self.rect.x, self.rect.y = x,y
2015-04-29 09:48:37 +01:00
def move(self, value):
self.rect.x += value
self.rect.clamp_ip(self.window_rect)