def __init__(self, grid): self.img, self.rect = media.load_png("Candleman.png") self.name = "Tim" self.Px = 0 # Indice de su ubicación en el mapa self.Py = 0 self.deck = cards.deck(10) grid.putinmiddle(self, (self.Px, self.Py))
def __init__(self): super(init, self).__init__() self.FONT = pygame.font.Font(None, 46) self.text = self.FONT.render("Tim Invaded The Moon", 1, (240, 230, 180)) self.background, self.RECT = media.load_png("background.png") self.alpha = 0 self.pos = self.text.get_rect() self.pos.center = screen.get_rect().center
def __init__(self, type=None): self.image, self.rect = media.load_png("card.png") self.type = type self.rect.topleft = (0, 0) self.grab = False self.used = False self.x2 = pygame.transform.scale( self.image, (self.rect.width * 5 // 2, self.rect.height * 5 // 2)) self.rect = self.x2.get_rect()
def __init__(self, grid): self.img, self.rect = media.load_png("SpaceGhost.png") self.Px, self.Py = 0, 0 while grid.mapa[self.Px, self.Py].peso >= 10: self.Px = random.randint(0, grid.num - 1) self.Py = random.randint(0, grid.num - 1) grid.putinmiddle(self, (self.Px, self.Py)) self.Vx = 1 self.Vy = 1 self.name = 'Ghost'
def __init__(self): super(TitleScene, self).__init__() self.background, self.RECT = media.load_png("background.png") self.box1 = pygame.Rect(50, 50, 100, 50) self.box2 = pygame.Rect(50, 200, 100, 50)
import GUI # import math # from pygame import math as PyM # Initialize the pygame pygame.init() clock = pygame.time.Clock() # Create the screen AWin = (Width, Height) = (600, 450) RGB = (255, 125, 180) screen = pygame.display.set_mode(AWin) # Title and Icon pygame.display.set_caption("Invader's Tim") icon, _ = media.load_png("Tim_Brown.jpg") pygame.display.set_icon(icon) # --Title Scene-- class TitleScene(Manage.Scene): def __init__(self): super(TitleScene, self).__init__() self.background, self.RECT = media.load_png("background.png") self.box1 = pygame.Rect(50, 50, 100, 50) self.box2 = pygame.Rect(50, 200, 100, 50) def render(self, screen): screen.blit(self.background, (0, 0)) pygame.draw.rect(screen, (0, 255, 0), self.box1) pygame.draw.rect(screen, (255, 0, 0), self.box2)
def __init__(self, player, gui): super(moving_card, self).__init__(MOVE) self.front, self.rect = media.load_png("move_card.png") self.player = player self.description = '''Move player 1 to 6 steps''' self.gui = gui
def __init__(self, name, nam_image): self.name = name self.img, self.rect = media.load_png(nam_image) self.Px = 0 self.Py = 0