示例#1
0
 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))
示例#2
0
 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
示例#3
0
 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()
示例#4
0
 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'
示例#5
0
 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)
示例#6
0
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)
示例#7
0
 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
示例#8
0
 def __init__(self, name, nam_image):
     self.name = name
     self.img, self.rect = media.load_png(nam_image)
     self.Px = 0
     self.Py = 0