Skip to content
TheChatArchiveThe Chat Archive
Amazon Novaamazon.nova-pro-v1:0· AmazonHugging Face LMArena Human Preference 140K

Create a retro-themed, avatar the last airbender bending arcade game in Pygame. The game…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Qwenqwen3-235b-a22b-no-thinking’s answer.
  1. User

    Create a retro-themed, avatar the last airbender bending arcade game in Pygame. The game design looks like it could have been played in an arcade back in the 80's. Do not rely on external file uploads and instead create your own assets and designs.

  2. Amazon Nova Assistant

    Certainly! Below is a simple implementation of a retro-themed "Avatar: The Last Airbender" bending arcade game using Pygame. This game will feature basic mechanics where the player can switch between bending elements (water, earth, fire, air) to defeat enemies.

    First, ensure you have Pygame installed:

    pip install pygame
    

    Here's the complete code for the game:

    import pygame
    import random
    import math
    
    # Initialize Pygame
    pygame.init()
    
    # Constants
    SCREEN_WIDTH = 800
    SCREEN_HEIGHT = 600
    PLAYER_SIZE = 50
    ENEMY_SIZE = 50
    BEND_COOLDOWN = 30  # frames
    
    # Colors
    WHITE = (255, 255, 255)
    BLACK = (0, 0, 0)
    BLUE = (0, 0, 255)
    GREEN = (0, 255, 0)
    RED = (255, 0, 0)
    YELLOW = (255, 255, 0)
    
    # Setup display
    screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
    pygame.display.set_caption("Avatar: The Last Airbender - Bending Arcade")
    
    # Player class
    class Player(pygame.sprite.Sprite):
        def __init__(self):
            super().__init__()
            self.image = pygame.Surface((PLAYER_SIZE, PLAYER_SIZE))
            self.image.fill(YELLOW)
            self.rect = self.image.get_rect()
            self.rect.center = (SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2)
            self.bend_cooldown = 0
            self.current_bend = "none"
    
        def update(self):
            keys = pygame.key.get_pressed()
            if keys[pygame.K_LEFT]:
                self.rect.x -= 5
            if keys[pygame.K_RIGHT]:
                self.rect.x += 5
            if keys[pygame.K_UP]:
                self.rect.y -= 5
            if keys[pygame.K_DOWN]:
                self.rect.y += 5
    
            if self.bend_cooldown > 0:
                self.bend_cooldown -= 1
    
            if keys[pygame.K_1] and self.bend_cooldown == 0:
                self.current_bend = "water"
                self.bend_cooldown = BEND_COOLDOWN
            elif keys[pygame.K_2] and self.bend_cooldown == 0:
                self.current_bend = "earth"
                self.bend_cooldown = BEND_COOLDOWN
            elif keys[pygame.K_3] and self.bend_cooldown == 0:
                self.current_bend = "fire"
                self.bend_cooldown = BEND_COOLDOWN
            elif keys[pygame.K_4] and self.bend_cooldown == 0:
                self.current_bend = "air"
                self.bend_cooldown = BEND_COOLDOWN
    
        def bend(self):
            if self.current_bend == "water":
                return pygame.Rect(self.rect.centerx - 20, self.rect.y, 40, 20)
            elif self.current_bend == "earth":
                return pygame.Rect(self.rect.x, self.rect.y, 20, 20)
            elif self.current_bend == "fire":
                return pygame.Rect(self.rect.centerx, self.rect.y - 20, 20, 40)
            elif self.current_bend == "air":
                return pygame.Rect(self.rect.x, self.rect.y, 20, 20)
            return None
    
    # Enemy class
    class Enemy(pygame.sprite.Sprite):
        def __init__(self):
            super().__init__()
            self.image = pygame.Surface((ENEMY_SIZE, ENEMY_SIZE))
            self.image.fill(RED)
            self.rect = self.image.get_rect()
            self.rect.x = random.randint(0, SCREEN_WIDTH - ENEMY_SIZE)
            self.rect.y = random.randint(0, SCREEN_HEIGHT - ENEMY_SIZE)
            self.speed = random.randint(1, 3)
    
        def update(self):
            self.rect.y += self.speed
            if self.rect.y > SCREEN_HEIGHT:
                self.rect.y = 0
                self.rect.x = random.randint(0, SCREEN_WIDTH - ENEMY_SIZE)
    
    # Groups
    all_sprites = pygame.sprite.Group()
    enemies = pygame.sprite.Group()
    
    player = Player()
    all_sprites.add(player)
    
    for _ in range(10):
        enemy = Enemy()
        all_sprites.add(enemy)
        enemies.add(enemy)
    
    # Game loop
    clock = pygame.time.Clock()
    running = True
    
    while running:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                running = False
    
        all_sprites.update()
    
        bend_rect = player.bend()
        if bend_rect:
            hit_enemies = pygame.sprite.spritecollide(player, enemies, True)
            for enemy in hit_enemies:
                enemy = Enemy()
                all_sprites.add(enemy)
                enemies.add(enemy)
    
        screen.fill(BLACK)
        all_sprites.draw(screen)
    
        if bend_rect:
            pygame.draw.rect(screen, BLUE, bend_rect)
    
        pygame.display.flip()
        clock.tick(30)
    
    pygame.quit()
    

    Explanation:

    1. Player Class: The player can move using arrow keys and bend elements using number keys (1 for water, 2 for earth, 3 for fire, 4 for air). Each bend has a cooldown.
    2. Enemy Class: Enemies move downward at random speeds. When they reach the bottom, they respawn at the top.
    3. Game Loop: Handles events, updates sprites, checks for collisions between bends and enemies, and redraws the screen.

    This is a basic implementation. You can expand it by adding more features, improving graphics, and refining gameplay mechanics.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.