import pygame import sys import random pygame.init() # === Screen Setup === SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) pygame.display.set_caption("Ultimate Clicker Game - Hardcore Mode") # === Colors === WHITE = (255, 255, 255) BLUE = (0, 120, 255) GRAY = (180, 180, 180) GREEN = (0, 200, 100) DARK_GRAY = (50, 50, 50) YELLOW = (255, 215, 0) BLACK = (0, 0, 0) RED = (200, 0, 0) PURPLE = (180, 0, 255) ORANGE = (255, 100, 0) font = pygame.font.SysFont(None, int(SCREEN_HEIGHT * 0.05)) # === Game State === score = 0 click_value = 1 prestige_level = 0 prestige_cost = 10000 prestige_multiplier = 1.25 # each level boosts click power by 25% auto_clickers = 0 auto_clicker_interval = 1000 last_auto_click_time = pygame.time.get_ticks() click_upgrade_cost = 10 auto_clicker_cost = 50 speed_upgrade_cost = 200 golden_click_cost = 500 nuke_cost = 2000 powerup_cost = 750 golden_active = False golden_end_time = 0 golden_duration = 5000 golden_multiplier = 3 golden_cooldown = 15000 last_golden_use = -golden_cooldown nuke_cooldown = 30000 last_nuke_use = -nuke_cooldown nuke_spawn_interval = 5000 last_nuke_spawn = 0 nuke_rect = None nuke_active = False nuke_is_real = True NUKE_SIZE = 40 leaderboard = [] MAX_LEADERBOARD = 5 CRIT_CHANCE = 0.05 CRIT_MULTIPLIER = 5 boss_spawn_interval = 30000 last_boss_spawn = 0 boss_rect = None boss_active = False boss_hits = 0 BOSS_HITS_REQUIRED = 10 BOSS_SIZE = 60 powerup_active = False powerup_end_time = 0 POWERUP_DURATION = 10000 fatigue_timer = pygame.time.get_ticks() fatigue_interval = 20000 fatigue_penalty = 1.05 btn_w = SCREEN_WIDTH // 3 btn_h = SCREEN_HEIGHT // 12 padding = SCREEN_HEIGHT // 30 click_button = pygame.Rect(SCREEN_WIDTH // 2 - btn_w // 2, SCREEN_HEIGHT // 2 - btn_h - padding, btn_w, btn_h) click_upgrade_btn = pygame.Rect(SCREEN_WIDTH // 2 - btn_w // 2, SCREEN_HEIGHT // 2 + padding, btn_w, btn_h) auto_clicker_btn = pygame.Rect(SCREEN_WIDTH // 2 - btn_w // 2, SCREEN_HEIGHT // 2 + btn_h + 2 * padding, btn_w, btn_h) speed_upgrade_btn = pygame.Rect(SCREEN_WIDTH // 2 - btn_w // 2, SCREEN_HEIGHT // 2 + 2 * btn_h + 3 * padding, btn_w, btn_h) golden_click_btn = pygame.Rect(SCREEN_WIDTH // 2 - btn_w // 2, SCREEN_HEIGHT // 2 + 3 * btn_h + 4 * padding, btn_w, btn_h) nuke_btn = pygame.Rect(SCREEN_WIDTH // 2 - btn_w // 2, SCREEN_HEIGHT // 2 + 4 * btn_h + 5 * padding, btn_w, btn_h) powerup_btn = pygame.Rect(SCREEN_WIDTH // 2 - btn_w // 2, SCREEN_HEIGHT // 2 + 5 * btn_h + 6 * padding, btn_w, btn_h) prestige_btn = pygame.Rect(SCREEN_WIDTH // 2 - btn_w // 2, SCREEN_HEIGHT // 2 + 6 * btn_h + 7 * padding, btn_w, btn_h) # === Shop toggle === shop_mode = False clock = pygame.time.Clock() running = True while running: now = pygame.time.get_ticks() # === Logic Updates === if now - last_auto_click_time >= auto_clicker_interval: auto_power = auto_clickers * (2 if powerup_active else 1) score += auto_power last_auto_click_time = now if golden_active and now >= golden_end_time: golden_active = False if powerup_active and now >= powerup_end_time: powerup_active = False if now - fatigue_timer >= fatigue_interval: auto_clicker_interval = int(auto_clicker_interval * fatigue_penalty) fatigue_timer = now if now - last_nuke_spawn >= nuke_spawn_interval: x = random.randint(50, SCREEN_WIDTH - 50) y = random.randint(150, SCREEN_HEIGHT - 50) nuke_rect = pygame.Rect(x, y, NUKE_SIZE, NUKE_SIZE) nuke_active = True last_nuke_spawn = now nuke_is_real = random.choice([True, False, True]) if now - last_boss_spawn >= boss_spawn_interval: bx = random.randint(100, SCREEN_WIDTH - 100) by = random.randint(200, SCREEN_HEIGHT - 100) boss_rect = pygame.Rect(bx, by, BOSS_SIZE, BOSS_SIZE) boss_active = True boss_hits = 0 last_boss_spawn = now # === Drawing === screen.fill(WHITE) display_click_value = int(click_value * (golden_multiplier if golden_active else 1) * (prestige_multiplier ** prestige_level)) screen.blit(font.render(f"Score: {score}", True, BLACK), (20, 20)) screen.blit(font.render(f"Click Power: {display_click_value}", True, BLACK), (20, 60)) screen.blit(font.render(f"Auto Clickers: {auto_clickers}", True, BLACK), (20, 100)) screen.blit(font.render(f"Prestige Level: {prestige_level}", True, DARK_GRAY), (20, 140)) screen.blit(font.render("Leaderboard:", True, DARK_GRAY), (SCREEN_WIDTH - 300, 20)) for idx, val in enumerate(sorted(leaderboard, reverse=True)[:MAX_LEADERBOARD]): screen.blit(font.render(f"{idx+1}. {val}", True, BLACK), (SCREEN_WIDTH - 300, 60 + idx * 30)) # === Buttons === def draw_button(rect, label, cost=None, active=True): color = GREEN if active else GRAY pygame.draw.rect(screen, color, rect) text = f"{label}" + (f" (${cost})" if cost is not None else "") label_surface = font.render(text, True, WHITE) screen.blit(label_surface, (rect.x + 10, rect.y + 10)) if shop_mode: draw_button(click_upgrade_btn, "Upgrade Click", click_upgrade_cost, score >= click_upgrade_cost) draw_button(auto_clicker_btn, "Buy Auto Clicker", auto_clicker_cost, score >= auto_clicker_cost) draw_button(speed_upgrade_btn, "Faster Auto-Click", speed_upgrade_cost, score >= speed_upgrade_cost) draw_button(golden_click_btn, "Golden Click", golden_click_cost, score >= golden_click_cost and (now - last_golden_use) >= golden_cooldown) draw_button(nuke_btn, "NUKE!!!", nuke_cost, score >= nuke_cost and (now - last_nuke_use) >= nuke_cooldown) draw_button(powerup_btn, "Double Auto (10s)", powerup_cost, score >= powerup_cost and not powerup_active) draw_button(prestige_btn, "Prestige", prestige_cost, score >= prestige_cost) else: draw_button(click_button, "Click Me!", active=True) # === Nuke / Boss Drawing === if nuke_active and nuke_rect: pygame.draw.circle(screen, RED if nuke_is_real else DARK_GRAY, nuke_rect.center, NUKE_SIZE // 2) label = "REAL" if nuke_is_real else "FAKE" screen.blit(font.render(label, True, WHITE), (nuke_rect.x + 2, nuke_rect.y + 5)) if boss_active and boss_rect: pygame.draw.rect(screen, PURPLE, boss_rect) screen.blit(font.render(f"{BOSS_HITS_REQUIRED - boss_hits}", True, WHITE), (boss_rect.x + 10, boss_rect.y + 5)) # === Event Handling === for event in pygame.event.get(): if event.type == pygame.QUIT: if score > 0: leaderboard.append(score) leaderboard = sorted(leaderboard, reverse=True)[:MAX_LEADERBOARD] running = False elif event.type == pygame.KEYDOWN: if event.key == pygame.K_s: shop_mode = not shop_mode elif event.type == pygame.MOUSEBUTTONDOWN: if not shop_mode: if click_button.collidepoint(event.pos): crit = random.random() < CRIT_CHANCE boost = CRIT_MULTIPLIER if crit else 1 score += display_click_value * boost else: if click_upgrade_btn.collidepoint(event.pos) and score >= click_upgrade_cost: score -= click_upgrade_cost click_value += 1 click_upgrade_cost = int(click_upgrade_cost * 1.6) elif auto_clicker_btn.collidepoint(event.pos) and score >= auto_clicker_cost: score -= auto_clicker_cost auto_clickers += 1 auto_clicker_cost = int(auto_clicker_cost * 1.9) elif speed_upgrade_btn.collidepoint(event.pos) and score >= speed_upgrade_cost: score -= speed_upgrade_cost auto_clicker_interval = max(100, int(auto_clicker_interval * 0.8)) speed_upgrade_cost = int(speed_upgrade_cost * 2.2) elif golden_click_btn.collidepoint(event.pos) and score >= golden_click_cost and (now - last_golden_use) >= golden_cooldown: score -= golden_click_cost golden_active = True golden_end_time = now + golden_duration last_golden_use = now golden_click_cost = int(golden_click_cost * 2.5) elif nuke_btn.collidepoint(event.pos) and score >= nuke_cost and (now - last_nuke_use) >= nuke_cooldown: score += 1000 click_value = 1 auto_clickers = 0 auto_clicker_interval = 1000 last_nuke_use = now score -= nuke_cost nuke_cost = int(nuke_cost * 2) elif powerup_btn.collidepoint(event.pos) and score >= powerup_cost and not powerup_active: score -= powerup_cost powerup_active = True powerup_end_time = now + POWERUP_DURATION powerup_cost = int(powerup_cost * 2) elif prestige_btn.collidepoint(event.pos) and score >= prestige_cost: prestige_level += 1 score = 0 click_value = 1 auto_clickers = 0 auto_clicker_interval = 1000 prestige_cost = int(prestige_cost * 3) if nuke_active and nuke_rect and nuke_rect.collidepoint(event.pos): if nuke_is_real: score += 1000 click_value = 1 auto_clickers = 0 auto_clicker_interval = 1000 else: score = max(0, score - 500) nuke_active = False nuke_rect = None elif boss_active and boss_rect and boss_rect.collidepoint(event.pos): boss_hits += 1 if boss_hits >= BOSS_HITS_REQUIRED: score += 2000 boss_active = False boss_rect = None pygame.display.flip() clock.tick(60) pygame.quit() sys.exit()