Subway Surfers For Linux -

# Spawn coins (more frequent than obstacles) if frame % random.randint(25, 45) == 0: track = random.randint(0, 2) coins.append(Coin(track, WIDTH))

def update(self, speed): self.x -= speed self.rect.x = self.x

def draw(self, surf): pygame.draw.rect(surf, RED, self.rect) pygame.draw.rect(surf, BLACK, self.rect, 2) Subway Surfers For Linux

show_score(score, screen) show_coins(total_coins, screen)

def off_screen(self): return self.x + OBSTACLE_WIDTH < 0 class Coin: def (self, track, x): self.track = track self.x = x self.rect = pygame.Rect(x, TRACK_Y[track] + 8, COIN_SIZE, COIN_SIZE) # Spawn coins (more frequent than obstacles) if

def off_screen(self): return self.x + COIN_SIZE < 0 def show_score(score, surf): text = font.render(f"Score: score", True, BLACK) surf.blit(text, (10, 10))

# Draw everything screen.fill(WHITE)

def update(self, speed): self.x -= speed self.rect.x = self.x

Partilhar por e-mail Fechar

 
 
 
 
Livro adicionado ao carrinho
De momento, este livro não está disponível para encomenda.