Create a retro-themed, bug 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.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Here's a retro-themed bug arcade game written in Python using Pygame, designed to look like it could have been played in an 80's arcade. This game includes:
Pixel-style graphics (drawn directly in code)
Bugs flying around the screen
A crosshair for aiming
Clicking to "zap" bugs for points
Retro sound effects (simulated with basic pygame.mixer)
Simple score tracking and game over condition
✅ Requirements:
Make sure you have Pygame installed:
bash
pip install pygame
🕹️ Game Description:
You are a bug zapper defending your arcade cabinet from an invasion of pixel bugs! Use your mouse to aim and click to zap bugs. Each bug hit gives you points. If a bug reaches the bottom of the screen, you lose a life. Lose all lives, and it's Game Over!
🐞 Retro Bug Arcade Game - Full Code:
python
import pygame
import random
import math
import sys
# Initialize Pygame
pygame.init()
# Screen settings
WIDTH, HEIGHT = 640, 480
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Bug Zapper '85")
# Clock
clock = pygame.time.Clock()
FPS = 60
# Colors (retro palette)
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
YELLOW = (255, 255, 0)
CYAN = (0, 255, 255)
# Fonts
font = pygame.font.SysFont("Courier New", 20, bold=True)
title_font = pygame.font.SysFont("Courier New", 36, bold=True)
# Game variables
score = 0
lives = 3
game_active = True
# Sound effects
pygame.mixer.init()
zap_sound = pygame.mixer.Sound(buffer=pygame.sndarray.make_sound(
pygame.sndarray.array(pygame.mixer.get_init()[0], [[32767 if i % 2 == 0 else -32768 for i in range(100)]])))
miss_sound = pygame.mixer.Sound(buffer=pygame.sndarray.make_sound(
pygame.sndarray.array(pygame.mixer.get_init()[0], [[32767 if i < 50 else 0 for i in range(200)]])))
# Bug class
class Bug:
def __init__(self):
self.size = random.randint(10, 20)
self.x = random.randint(self.size, WIDTH - self.size)
self.y = -self.size
self.speed = random.uniform(1.5, 3.0)
self.color = random.choice([GREEN, RED, YELLOW, CYAN])
def move(self):
self.y += self.speed
def draw(self, surface):
# Draw a simple bug (like a circle with legs)
pygame.draw.circle(surface, self.color, (int(self.x), int(self.y)), self.size)
leg_offset = self.size + 2
pygame.draw.line(surface, self.color, (self.x - leg_offset, self.y), (self.x - 5, self.y + 5), 2)
pygame.draw.line(surface, self.color, (self.x + leg_offset, self.y), (self.x + 5, self.y + 5), 2)
def check_offscreen(self):
return self.y - self.size > HEIGHT
def is_hit(self, pos):
return math.hypot(pos[0] - self.x, pos[1] - self.y) < self.size
# Crosshair
class Crosshair:
def __init__(self):
self.image = pygame.Surface((20, 20), pygame.SRCALPHA)
pygame.draw.circle(self.image, WHITE, (10, 10), 10, 1)
pygame.draw.line(self.image, WHITE, (0, 10), (20, 10), 1)
pygame.draw.line(self.image, WHITE, (10, 0), (10, 20), 1)
def draw(self, surface):
mx, my = pygame.mouse.get_pos()
surface.blit(self.image, (mx - 10, my - 10))
# Game functions
def draw_text(text, font, color, surface, x, y):
textobj = font.render(text, True, color)
rect = textobj.get_rect(center=(x, y))
surface.blit(textobj, rect)
def show_game_over():
screen.fill(BLACK)
draw_text("GAME OVER", title_font, RED, screen, WIDTH // 2, HEIGHT // 2 - 40)
draw_text(f"Final Score: {score}", font, WHITE, screen, WIDTH // 2, HEIGHT // 2 + 20)
draw_text("Click to Restart", font, CYAN, screen, WIDTH // 2, HEIGHT // 2 + 60)
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()
if event.type == pygame.MOUSEBUTTONDOWN:
waiting = False
def reset_game():
global score, lives, bugs
score = 0
lives = 3
bugs = []
game_active = True
return game_active
# Main loop
crosshair = Crosshair()
bugs = []
SPAWN_EVENT = pygame.USEREVENT + 1
pygame.time.set_timer(SPAWN_EVENT, 1000) # Spawn a bug every second
running = True
while running:
clock.tick(FPS)
screen.fill(BLACK)
# Events
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if not game_active and event.type == pygame.MOUSEBUTTONDOWN:
game_active = reset_game()
if game_active and event.type == SPAWN_EVENT:
bugs.append(Bug())
if game_active and event.type == pygame.MOUSEBUTTONDOWN:
hit = False
pos = pygame.mouse.get_pos()
for bug in bugs:
if bug.is_hit(pos):
zap_sound.play()
bugs.remove(bug)
score += 1
hit = True
break
if not hit:
miss_sound.play()
if game_active:
# Update
for bug in bugs[:]:
bug.move()
if bug.check_offscreen():
bugs.remove(bug)
lives -= 1
if lives <= 0:
game_active = False
show_game_over()
# Draw
crosshair.draw(screen)
for bug in bugs:
bug.draw(screen)
# HUD
draw_text(f"Score: {score}", font, WHITE, screen, 60, 20)
draw_text(f"Lives: {lives}", font, RED, screen, WIDTH - 60, 20)
else:
show_game_over()
pygame.display.flip()
pygame.quit()
🎮 Controls:
Mouse Move – Aim your crosshair
Left Click – Zap bugs!
Click after Game Over – Restart the game
🖼️ Visual Style:
Retro pixel-style graphics (hand-drawn with pygame.draw)
Bright neon colors (Green, Red, Yellow, Cyan)
Simple circular bugs with "legs"
Crosshair made of lines and a circle
🔊 Sound Effects:
Zap sound – Short, high-pitched beep
Miss sound – A short buzz
These are simulated using raw sound arrays since no external files are allowed.
📝 Ideas for Expansion:
Add power-ups (e.g., freeze, multi-zap)
Introduce different bug types (faster, bigger, or smarter)
Add background music
Include high score tracking
Let me know if you'd like a version with images, sound effects, or more advanced features like levels, power-ups, or boss bugs! 🐞💥