Exemple #1
0
 def initCar(self, batch):
     self.ui = shapes.Rectangle(
         self.pos % Config.SCREEN_WIDTH,
         Config.SCREEN_HEIGHT -
         (int(self.pos / Config.SCREEN_WIDTH) * Config.CAR_HEIGHT),
         Config.CAR_SIZE,
         Config.CAR_HEIGHT,
         color=self.getColor(),
         batch=batch)
 def __init__(self, speed, width, height, x_pos, y_pos, background, color):
     self.speed = speed
     self.width = width
     self.height = height
     self.x_pos = x_pos
     self.y_pos = y_pos
     self.background = background
     self.color = color
     # Rectangle
     self.scale = 0.25
     self.hitbox = shapes.Rectangle(x_pos, y_pos, width, height, color=color, batch=self.background)
Exemple #3
0
    def __init__(self):
        super().__init__()

        self.sprite = shapes.Rectangle(x=500,
                                       y=500,
                                       width=25,
                                       height=25,
                                       color=(255, 0, 0),
                                       batch=self.spriteBatch)
        self.sprite.anchor_x = self.sprite.x // 2
        self.sprite.anchor_y = self.sprite.y // 2