Skip to content
TheChatArchiveThe Chat Archive
o3-mini· OpenAIHugging 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. Assistant

    Below is a complete Python script using Pygame that implements a retro‐themed “Avatar: The Last Airbender Bending Arcade Game.” In this game you control “The Avatar” (represented by a pixelated icon) at the bottom of the screen. You can move left/right and select one of four bending “modes” (air, water, earth, or fire) using keys 1–4. Press the spacebar to launch a bending projectile in the currently selected mode. Enemies (abstractly represented) descend from the top of the screen, and you must hit them with your bending attack to score points. The graphics and sounds (if any) are created “on the fly” using Pygame’s drawing functions so that no external asset files are needed. The style is made to look reminiscent of an 80’s arcade game!

    Simply run the code (make sure you have Pygame installed) and enjoy this retro nod to classic arcade gameplay inspired by Avatar. You can modify the colors, speeds, and other parameters for your own custom feel.

    Below is the full code:


    import pygame
    import random
    import sys
    
    # Initialize Pygame
    pygame.init()
    
    # ------------------
    # Game Window Setup
    # ------------------
    WIDTH, HEIGHT = 480, 640
    screen = pygame.display.set_mode((WIDTH, HEIGHT))
    pygame.display.set_caption("Avatar: The Last Airbender Bending Arcade")
    
    # Clock for framerate
    clock = pygame.time.Clock()
    FPS = 60
    
    # ------------------
    # Colors and Assets
    # ------------------
    # Define some retro colors
    BLACK   = (0, 0, 0)
    WHITE   = (255, 255, 255)
    GRAY    = (100, 100, 100)
    YELLOW  = (255, 255, 0)
    
    # Bending style colors (feel free to adjust!)
    BENDING_MODES = {
        "air":    (200, 230, 255),  # light blue-white
        "water":  (100, 149, 237),  # cornflower blue
        "earth":  (139, 69, 19),    # brown
        "fire":   (255, 69, 0)      # orange-red
    }
    MODE_LIST = ["air", "water", "earth", "fire"]
    
    # Retro font (a common 80's feel!)
    font_small = pygame.font.SysFont("Courier", 16, bold=True)
    font_large = pygame.font.SysFont("Courier", 32, bold=True)
    
    # ------------------
    # Game Object Classes
    # ------------------
    
    class Player(pygame.sprite.Sprite):
        def __init__(self):
            super().__init__()
            # Create a simple retro-styled avatar as a pixelated figure:
            self.image = pygame.Surface((40, 40))
            self.image.fill(BLACK)
            # Draw a circle (the head) and a rectangle body ("pixel art")
            pygame.draw.circle(self.image, WHITE, (20, 15), 8)
            pygame.draw.rect(self.image, WHITE, (12, 25, 16, 12))
            self.rect = self.image.get_rect()
            self.rect.midbottom = (WIDTH // 2, HEIGHT - 10)
            self.speed = 5
            self.bending_mode = "air"
    
        def update(self):
            keys = pygame.key.get_pressed()
            if keys[pygame.K_LEFT]:
                self.rect.x -= self.speed
            if keys[pygame.K_RIGHT]:
                self.rect.x += self.speed
                
            # Keep player within screen bounds
            if self.rect.left < 0:
                self.rect.left = 0
            if self.rect.right > WIDTH:
                self.rect.right = WIDTH
    
    class Projectile(pygame.sprite.Sprite):
        def __init__(self, x, y, mode):
            super().__init__()
            self.mode = mode
            self.color = BENDING_MODES[mode]
            # projectile is just a simple rectangle with a “spark” look
            self.image = pygame.Surface((8, 16))
            self.image.fill(self.color)
            self.rect = self.image.get_rect()
            self.rect.center = (x, y)
            self.speed = -7
    
            # To add a retro “pixelated fading trail”, we will store sub-rectangles that slowly fade.
            self.trail = []
    
        def update(self):
            # Move the projectile
            self.rect.y += self.speed
    
            # Create a trail effect
            self.trail.append(self.rect.copy())
            if len(self.trail) > 10:
                self.trail.pop(0)
    
            # Remove if off the screen
            if self.rect.bottom < 0:
                self.kill()
    
        def draw_trail(self, surface):
            for i, rect in enumerate(self.trail):
                # Fade out older trail segments
                alpha = max(50, 255 - i * 20)
                trail_surf = pygame.Surface((rect.width, rect.height))
                trail_surf.fill(self.color)
                trail_surf.set_alpha(alpha)
                surface.blit(trail_surf, rect.topleft)
    
    class Enemy(pygame.sprite.Sprite):
        def __init__(self):
            super().__init__()
            # Create a simple enemy as a retro pixel art shape
            size = random.choice([30, 35, 40])
            self.image = pygame.Surface((size, size))
            self.image.fill(BLACK)
            # Use a contrasting color from the palette randomly for the enemy outline
            enemy_color = random.choice([YELLOW, GRAY, WHITE])
            pygame.draw.rect(self.image, enemy_color, self.image.get_rect(), 3)
            self.rect = self.image.get_rect()
            self.rect.x = random.randint(0, WIDTH - self.rect.width)
            self.rect.y = -self.rect.height
            self.speed = random.randint(2, 4)
    
        def update(self):
            self.rect.y += self.speed
            if self.rect.top > HEIGHT:
                self.kill()  # remove off-screen enemy
    
    # ------------------
    # Game States and Main Loop
    # ------------------
    
    def draw_text(surface, text, font, color, pos):
        text_obj = font.render(text, True, color)
        surface.blit(text_obj, pos)
    
    def show_start_screen():
        screen.fill(BLACK)
        draw_text(screen, "Avatar Bending Arcade", font_large, WHITE, (40, HEIGHT//2 - 60))
        draw_text(screen, "Press Enter to Start", font_small, WHITE, (WIDTH//2 - 80, HEIGHT//2))
        pygame.display.flip()
        waiting = True
        while waiting:
            clock.tick(FPS)
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    pygame.quit()
                    sys.exit()
                elif event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_RETURN:
                        waiting = False
    
    def show_game_over_screen(score):
        screen.fill(BLACK)
        draw_text(screen, "GAME OVER", font_large, WHITE, (WIDTH//2 - 100, HEIGHT//2 - 80))
        draw_text(screen, f"Score: {score}", font_small, WHITE, (WIDTH//2 - 40, HEIGHT//2 - 20))
        draw_text(screen, "Press Enter to Restart", font_small, WHITE, (WIDTH//2 - 90, HEIGHT//2 + 20))
        pygame.display.flip()
        waiting = True
        while waiting:
            clock.tick(FPS)
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    pygame.quit()
                    sys.exit()
                elif event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_RETURN:
                        waiting = False
    
    def main():
        # Sprite groups
        all_sprites = pygame.sprite.Group()
        projectiles = pygame.sprite.Group()
        enemies = pygame.sprite.Group()
    
        player = Player()
        all_sprites.add(player)
    
        score = 0
        enemy_spawn_delay = 1500  # spawn enemy every 1.5 sec
        last_enemy_spawn = pygame.time.get_ticks()
    
        # Game Loop
        running = True
        while running:
            clock.tick(FPS)
            current_time = pygame.time.get_ticks()
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    running = False
    
                # Mode selection: keys 1-4
                elif event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_1:
                        player.bending_mode = "air"
                    elif event.key == pygame.K_2:
                        player.bending_mode = "water"
                    elif event.key == pygame.K_3:
                        player.bending_mode = "earth"
                    elif event.key == pygame.K_4:
                        player.bending_mode = "fire"
                    # Fire a projectile
                    elif event.key == pygame.K_SPACE:
                        proj = Projectile(player.rect.centerx, player.rect.top, player.bending_mode)
                        all_sprites.add(proj)
                        projectiles.add(proj)
    
            # Spawn enemies periodically
            if current_time - last_enemy_spawn > enemy_spawn_delay:
                enemy = Enemy()
                all_sprites.add(enemy)
                enemies.add(enemy)
                last_enemy_spawn = current_time
    
            # Update all sprites
            all_sprites.update()
    
            # Check for collisions between projectiles and enemies
            hits = pygame.sprite.groupcollide(enemies, projectiles, True, True)
            if hits:
                score += len(hits) * 10  # 10 points per enemy
    
            # Render the game screen
            screen.fill((20, 20, 40))  # A dark retro background
    
            # Draw a subtle grid for retro style
            grid_color = (40, 40, 60)
            for x in range(0, WIDTH, 20):
                pygame.draw.line(screen, grid_color, (x,0),(x,HEIGHT))
            for y in range(0, HEIGHT, 20):
                pygame.draw.line(screen, grid_color, (0,y),(WIDTH,y))
    
            # Draw sprites
            for sprite in all_sprites:
                # If sprite is projectile and has a trail, first draw trail.
                if isinstance(sprite, Projectile):
                    sprite.draw_trail(screen)
                screen.blit(sprite.image, sprite.rect)
    
            # Draw HUD (score and bending mode)
            draw_text(screen, f"Score: {score}", font_small, WHITE, (10, 10))
            draw_text(screen, f"Mode: {player.bending_mode.upper()}", font_small, BENDING_MODES[player.bending_mode], (10, 30))
            draw_text(screen, "Select Mode: [1]Air [2]Water [3]Earth [4]Fire", font_small, GRAY, (10, HEIGHT - 30))
    
            pygame.display.flip()
    
            # Check for losing condition: if an enemy gets too low (hits the bottom)
            for enemy in enemies:
                if enemy.rect.bottom >= HEIGHT - 10:
                    running = False
    
        show_game_over_screen(score)
    
    if __name__ == '__main__':
        show_start_screen()
        while True:
            main()
    

    How It Works

    1. Player Control:
      Use the left/right arrow keys to move the avatar. Choose the bending mode by pressing 1 (Air), 2 (Water), 3 (Earth), or 4 (Fire). Press the spacebar to fire a projectile in the currently selected bending mode.

    2. Projectile & Enemy Mechanics:
      Projectiles are colored rectangles that leave a short fading trail behind them (a retro “pixel trail” effect). Enemies are generated randomly from the top of the screen and move downward. Hitting them with your bending projectile increases your score.

    3. Retro Feel:
      The background grid, pixelated avatar, and simple geometric shapes help evoke the look and feel of an 80’s arcade game. The built-in fonts and color choices further add to the nostalgic experience.

    4. Game Flow:
      The game starts with a welcome screen. When an enemy reaches the bottom of the screen, you lose—and a game-over screen displays your score and prompts you to restart.

    Enjoy your retro Avatar bending arcade game! Feel free to experiment with speeds, enemy spawn rates, and visual styles to create your perfect retro experience.

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