Untitled
Fighters: Arena"import pygame import random pygame.init() WIDTH, HEIGHT = 800, 600 screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Food ) WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) clock = pygame.time.Clock() FPS = 60 characters = ["Pizza Pistolero", "Burger Blaster", "Sushi Samurai"] gadgets = {"Pizza Pistolero": "Ketchup Bomb", "Burger Blaster": "Pickle Shield", "Sushi Samurai": "Wasabi Strike"} food_powers = {"Pizza Pistolero": "Exploding Slices", "Burger Blaster": "Mega Burger", "Sushi Samurai": "Sushi Storm"} overdrives = {"Pizza Pistolero": "Pizza Inferno", "Burger Blaster": "Ultimate Feast", "Sushi Samurai": "Tsunami Roll"} player = { "name": "Player1", "character": "Pizza Pistolero", "level": 1, "gadget": None, "food_power": None, "overdrive": None, "coins": 0, "trophies": 0 } def draw_text(text, font, color, x, y): rendered_text = font.render(text, True, color) screen.blit(rendered_text, (x, y)) def display_player_info(): font = pygame.font.Font(None, 36) draw_text(f"Character: {player['character']}", font, WHITE, 10, 10) draw_text(f"Level: {player['level']}", font, WHITE, 10, 50) draw_text(f"Coins: {player['coins']}", font, WHITE, 10, 90) draw_text(f"Trophies: {player['trophies']}", font, WHITE, 10, 130) def simulate_match(): # Simulates a match outcome outcome = random.choice(["win", "lose", "draw"]) if outcome == "win": player['trophies'] += 8 player['coins'] += 20 elif outcome == "lose": player['trophies'] -= 6 elif outcome == "draw": player['trophies'] += 1 return outcome running = True while running: screen.fill(BLACK) for event in pygame.event.get(): if event.type == pygame.QUIT: running = False # Display player info display_player_info() # Simulate a match every few seconds if random.randint(1, 120) == 1: # Random trigger for match simulation result = simulate_match() print(f"Match result: {result}") pygame.display.flip() clock.tick(FPS) pygame.quit()
Leave a Comment