# data[].attributes.body
(pygame := __import__('pygame')), pygame.init(), (screen := pygame.display.set_mode((600, 600))), (shapes := []), (font := pygame.font.Font(None, 36)), (c_button := pygame.Rect(10, 10, 150, 50)),(r_button := pygame.Rect(200, 10, 150, 50)), (mode := None), (func := lambda: ((pos := pygame.mouse.get_pos()), [pygame.quit() if event.type == pygame.QUIT else ((mode:="circle") if c_button.collidepoint(pos) else (((mode:="rectangle") if r_button.collidepoint(pos) else shapes.append(mode, pos))) if event.type == pygame.MOUSEBUTTONDOWN else 1) for event in pygame.event.get()], [pygame.draw.circle(screen, (255, 0, 0), shape[1], 20) if shape[0] == "circle" else pygame.draw.rect(screen, (0, 255, 0), (*shape[1], 50, 30)) for shape in shapes], (color := (255, 0, 0)), pygame.draw.rect(screen, color if mode == "circle" else color[::-1], c_button), screen.blit(font.render("Circle", True, (255, 255, 255)), (c_button.x + 10, c_button.y + 10)), pygame.draw.rect(screen, color if mode == "rectangle" else color[::-1], r_button), screen.blit(font.render("Rectangle", True, (255, 255, 255)), (r_button.x + 10, r_button.y + 10)), pygame.display.flip(), func()))

# data[].attributes.body
import pygame

pygame.init()

screen_width = 500

screen = pygame.display.set_mode([screen_width, screen_width])

clock = pygame.time.Clock()

count = 0

running = True

font = pygame.font.Font(None, 36)

text = font.render("Everyone likes Farting!", True, (0,0,0))

while running:

screen.fill((255,255,255))

pos = pygame.mouse.get_pos()

pygame.display.update()

clock.tick(60)

for event in pygame.event.get():

if event.type == pygame.QUIT:

running = False

if event.type == pygame.MOUSEBUTTONDOWN:

print(pos)

draw. Rectangle

# data[].attributes.body
import pygame

pygame.init()

screen_width = 500

screen = pygame.display.set_mode([screen_width, screen_width])

pygame.display.set_caption("My Pygame Window")

player_image = pygame.image.load("player_image.png").convert()

player_rect = player_image.get_rect()

clock = pygame.time.Clock()

button = pygame.Rect(190,227,100,50)

count = 0

running = True

while running:

screen.fill((255,255,255))

pygame.draw.rect(screen,(200, 200, 200), button)

pos = pygame.mouse.get_pos()

if button.collidepoint(pos):

pygame.draw.rect(screen, (125,200,200), button)

elif count < 50:

pygame.draw.rect(screen, (200,200,200), button)

elif count >= 50:

pygame.draw.rect(screen, (200, 200, 0), button)

pygame.display.update()

clock.tick(60)

for event in pygame.event.get():

if event.type == pygame.QUIT:

running = False

if event.type == pygame.MOUSEBUTTONDOWN:

if button.collidepoint(event.pos):

print("button clicked!")

count = count + 1

print(count)

# data[].attributes.body
pygame.init()

screen_width = 500

screen = pygame.display.set_mode([screen_width, screen_width])

pygame.display.set_caption("My Pygame Window")

player_image = pygame.image.load("player_image.png").convert()

player_rect = player_image.get_rect()

clock = pygame.time.Clock()

button = pygame.Rect(190,227,100,50)

running = True

while running:

screen.fill((255,255,255))

pygame.draw.rect(screen,(200, 200, 200), button)

pos = pygame.mouse.get_pos()

if button.collidepoint(pos):

pygame.draw.rect(screen, (125,200,200), button)

else:

pygame.draw.rect(screen, (200,200,200), button)

pygame.display.update()

clock.tick(60)

for event in pygame.event.get():

if event.type == pygame.QUIT:

running = False

if event.type == pygame.MOUSEBUTTONDOWN:

if event.button == 1:

print("Left mouse button clicked at",event.pos)

if event.button == 3:

print("Right mouse button clicked at",event.pos)

# data[].attributes.body
import pygame

pygame.init()

screen = pygame.display.set_mode([500,500])

pygame.display.set_caption("My Pygame Window")

player_image = pygame.image.load("player_image.png").convert()

player_rect = player_image.get_rect()

clock = pygame.time.Clock()

running = True

while running:

screen.fill((255,255,255))

pygame.display.update()

clock.tick(60)

for event in pygame.event.get():

if event.type == pygame.QUIT:

running = False

if event.type == pygame.MOUSEBUTTONDOWN:

if event.button == 1:

print("Left mouse button clicked at",event.pos)

if event.button == 3:

print("Right mouse button clicked at",event.pos)

# data[].attributes.body
Upload your replit link under here!

# data[].attributes.body
import pygame

import random

pygame.init()

WIDTH, HEIGHT = 650, 650

screen = pygame.display.set_mode((WIDTH, HEIGHT))

pygame.display.set_caption("My Pygame")

clock = pygame.time.Clock()

# Load images

player_image = pygame.image.load("Steve.png").convert_alpha()

zombie_base_image = pygame.image.load("Zombie.png").convert_alpha()

font = pygame.font.SysFont(None, 40)

button_font = pygame.font.SysFont(None, 36)

player_rect = player_image.get_rect(center=(WIDTH // 2, HEIGHT - 500))

player_speed = 5

steve_health = 30

bullet_damage = 2

bullet_speed = 10

waves = [

(10, 0, 0),

(8, 2, 0),

(5, 5, 0),

(3, 7, 0),

(0, 0, 1),

]

zombie_damage = {

"small": 3,

"big": 5,

"boss": 10,

}

zombie_max_health = {

"small": 10,

"big": 20,

"boss": 50,

}

button_width, button_height = 160, 50

button_rect = pygame.Rect((WIDTH - button_width) // 2, 420, button_width, button_height)

button_text = button_font.render("Restart", True, (255, 255, 255))

def scale_image(img, scale):

size = (int(img.get_width() scale), int(img.get_height() scale))

return pygame.transform.smoothscale(img, size)

class Zombie:

def init(self, x, y, z_type):

self.type = z_type

if z_type == "small":

self.image = zombie_base_image

elif z_type == "big":

self.image = scale_image(zombie_base_image, 1.5) # Big scaled 1.5x

else:

self.image = scale_image(zombie_base_image, 2.0) # Boss scaled 2.0x

self.rect = self.image.get_rect(midbottom=(x, y))

self.health = zombie_max_health[z_type]

def draw(self, surface):

surface.blit(self.image, self.rect)

bar_w = self.rect.width

bar_h = 6

fill_w = int(bar_w * (self.health / zombie_max_health[self.type]))

pygame.draw.rect(surface, (255,0,0), (self.rect.x, self.rect.y - 12, bar_w, bar_h))

pygame.draw.rect(surface, (0,255,0), (self.rect.x, self.rect.y - 12, fill_w, bar_h))

def move(self):

self.rect.y -= 2

def reset_game():

global player_rect, bullets, zombies, steve_health, current_wave, spawn_queue, spawn_timer

global game_state, wave_spawned_counts

player_rect.center = (WIDTH // 2, HEIGHT - 100)

bullets = []

zombies = []

steve_health = 30

current_wave = 0

game_state = "playing"

spawn_queue = []

spawn_timer = 0

wave_spawned_counts = {"small": 0, "big": 0, "boss": 0}

prepare_spawn_queue(current_wave)

return bullets, zombies

def prepare_spawn_queue(wave_idx):

global spawn_queue, wave_spawned_counts

spawn_queue = []

wave_spawned_counts = {"small": 0, "big": 0, "boss": 0}

small_count, big_count, boss_count = waves[wave_idx]

spawn_queue += ["small"] * small_count

spawn_queue += ["big"] * big_count

spawn_queue += ["boss"] * boss_count

random.shuffle(spawn_queue)

bullets = []

zombies = []

current_wave = 0

game_state = "playing"

spawn_queue = []

spawn_timer = 0

wave_spawned_counts = {"small": 0, "big": 0, "boss": 0}

prepare_spawn_queue(current_wave)

running = True

while running:

dt = clock.tick(60) / 1000

spawn_timer += dt

for event in pygame.event.get():

if event.type == pygame.QUIT:

running = False

if game_state in ["gameover", "win"] and event.type == pygame.MOUSEBUTTONDOWN:

if button_rect.collidepoint(event.pos):

bullets, zombies = reset_game()

keys = pygame.key.get_pressed()

if game_state == "playing":

if keys[pygame.K_LEFT] and player_rect.left > 0:

player_rect.x -= player_speed

if keys[pygame.K_RIGHT] and player_rect.right < WIDTH:

player_rect.x += player_speed

if keys[pygame.K_UP] and player_rect.top > 0:

player_rect.y -= player_speed

if keys[pygame.K_DOWN] and player_rect.bottom < HEIGHT:

player_rect.y += player_speed

# Shoot bullets continuously when holding space (no cooldown)

if keys[pygame.K_SPACE]:

bullet_rect = pygame.Rect(player_rect.centerx - 2, player_rect.bottom, 5, 10)

bullets.append(bullet_rect)

if spawn_queue and spawn_timer >= 0.8:

z_type = spawn_queue.pop(0)

x = random.randint(50, WIDTH - 50)

zombies.append(Zombie(x, HEIGHT + 20, z_type))

wave_spawned_counts[z_type] += 1

spawn_timer = 0

for b in bullets:

b.y += bullet_speed

bullets = [b for b in bullets if b.top < HEIGHT]

for z in zombies[:]:

z.move()

if z.rect.bottom < 0:

steve_health -= zombie_damage[z.type]

zombies.remove(z)

for bullet in bullets[:]:

for z in zombies[:]:

if bullet.colliderect(z.rect):

z.health -= bullet_damage

bullets.remove(bullet)

if z.health <= 0:

zombies.remove(z)

break

if steve_health <= 0:

game_state = "gameover"

wave_small, wave_big, wave_boss = waves[current_wave]

total_wave_zombies = wave_small + wave_big + wave_boss

total_spawned = sum(wave_spawned_counts.values())

if total_spawned total_wave_zombies and len(zombies) 0:

current_wave += 1

if current_wave == len(waves):

game_state = "win"

else:

prepare_spawn_queue(current_wave)

spawn_timer = 0

screen.fill((255, 255, 255))

screen.blit(player_image, player_rect)

for b in bullets:

pygame.draw.rect(screen, (0, 0, 0), b)

for z in zombies:

z.draw(screen)

health_text = font.render(f"Health: {steve_health}", True, (0, 0, 0))

screen.blit(health_text, (10, 10))

wave_text = font.render(f"Wave: {current_wave + 1 if current_wave < len(waves) else len(waves)}", True, (0, 0, 0))

screen.blit(wave_text, (WIDTH - 130, 10))

if game_state == "gameover":

msg = font.render("GAME OVER", True, (255, 0, 0))

screen.blit(msg, msg.get_rect(center=(WIDTH // 2, 250)))

final_health = font.render(f"Health left: {max(0, steve_health)}", True, (0, 0, 0))

screen.blit(final_health, final_health.get_rect(center=(WIDTH // 2, 300)))

pygame.draw.rect(screen, (0, 0, 255), button_rect)

screen.blit(button_text, button_text.get_rect(center=button_rect.center))

elif game_state == "win":

msg = font.render("CONGRATULATIONS!", True, (0, 128, 0))

screen.blit(msg, msg.get_rect(center=(WIDTH // 2, 250)))

final_health = font.render(f"Health left: {steve_health}", True, (0, 0, 0))

screen.blit(final_health, final_health.get_rect(center=(WIDTH // 2, 300)))

pygame.draw.rect(screen, (0, 0, 255), button_rect)

screen.blit(button_text, button_text.get_rect(center=button_rect.center))

pygame.display.flip()

pygame.quit()

# data[].attributes.custom_properties.8Qe_iEkA
you have to draw steve and the zombie and name the folder Steve.png and Zombie.png respectively.

# data[].attributes.body
instructions:

press spacebar to shoot zombie and score 50 points to win. =)

# data[].attributes.body
https://replit.com/@JerryDaMouse/Jerry-app#main.py

# data[].attributes.body
Task: Please make a post, title it your name, include the link of your replit project and the sprite you've made here!