add a debug mode to this game that turns on using the mashup Alt+F9 and also add spawn and create pages using debug mode and also add alot of cool features to it such as spawn powerups and godmode and flight: import pygame, random, sys
# [EASY] Importing libraries: pygame for game development, random for generating random numbers, and sys for system-level operations like exiting the program.

# [pygame.init()] is a function that initializes all the imported Pygame modules that require initialization.
pygame.init()
# [EASY] pygame.init(): Initializes Pygame's modules (like display, sound, etc.) so they can be used in the program.

WIDTH, HEIGHT = 600, 400
# [EASY] Defining constants: Sets the game window's width to 600 pixels and height to 400 pixels.

screen = pygame.display.set_mode((WIDTH, HEIGHT))
# [EASY] Creates a game window (surface) with the specified width and height where all graphics will be drawn.

pygame.display.set_caption("Cube Runner")
# [EASY] Sets the title of the game window to "Cube Runnin'".
0
font_small = pygame.font.SysFont(None, 24)
font_med = pygame.font.SysFont(None, 36)
font_large = pygame.font.SysFont(None, 48)
font_xlarge = pygame.font.SysFont(None, 72)
# [EASY] Creates font objects for rendering text in different sizes (24, 36, 48, 72 pixels). None uses the default system font.

WHITE = (255, 255, 255)
BLUE = (0, 0, 255)
DARK_BLUE = (0, 0, 139)  # New double points powerup color
DARKER_DOUBLE_POINTS = (0, 0, 50)  # Darker dark blue for double points
RED = (255, 0, 0)
DARK_RED = (180, 0, 0)
GREEN = (0, 255, 0)
YELLOW = (255, 255, 0)  # Shield color
BLACK = (0, 0, 0)
GRAY = (200, 200, 200)
TRANSPARENT_BLACK_180 = (0, 0, 0, 180)
# [EASY] Defines RGB (and RGBA for transparency) color tuples used for drawing objects. Each tuple represents (Red, Green, Blue, Alpha) values (0-255).

SPEED_GLOW_COLOR = (50, 255, 50)
SUPER_SHINY_PINK = (255, 100, 180)  # supershield pink glow color
OPSHIELD_COLOR = (180, 30, 90)  # opshield dark pink
# [EASY] Additional color definitions for specific powerup effects, like glowing or shields.

clock = pygame.time.Clock()
# [EASY] Creates a clock object to control the game's frame rate, ensuring smooth and consistent updates.

FPS = 60
floor_height = 40
player_size = 20
gravity = 1
jump_speed = 15
base_move_speed = 5
# [EASY] Constants for game mechanics: FPS (frames per second) sets game speed, floor_height and player_size define sizes, gravity affects falling, jump_speed and base_move_speed control player movement.

STATE_MENU, STATE_PLAYING, STATE_PAUSED, STATE_GAMEOVER = range(4)
# [EASY] Defines game states as integers (0 to 3) using range() to represent different modes: menu, playing, paused, and game over.

POWERUP_DURATION_FRAMES = FPS * 30
SHIELD_DURATION_FRAMES = FPS * 10
SUPERSHIELD_DURATION_FRAMES = FPS * 30
OPSHIELD_DURATION_FRAMES = FPS * 45
# [EASY] Sets durations for powerups in frames (e.g., 30 seconds at 60 FPS = 1800 frames). Each powerup type has a specific duration.

OPSHIELD_HITS = 6
# [EASY] Defines the number of hits an "opshield" (overpowered shield) can take before deactivating.

# def is a keyword used to define a function. Functions are reusable blocks of code that perform a specific task.
def draw_text_with_outline(surf, text, font, c, o, x, y, center=True):
    # [EASY] Function to draw text with an outline on a surface. Parameters: surface to draw on, text string, font, text color (c), outline color (o), x/y position, and centering option.

    ts, os = font.render(text, 1, c), font.render(text, 1, o)
    # [EASY] Renders the text twice: once for the main text (ts) with color c, and once for the outline (os) with color o. The '1' enables anti-aliasing for smoother edges.

    # the if statement is used for conditional execution of code.
    r = ts.get_rect(center=(x, y)) if center else ts.get_rect(topleft=(x, y))
    # [EASY] Gets the rectangle (position and size) for the text. If center=True, positions text centered at (x, y); otherwise, positions at top-left.

    # the for loop is used to iterate over a sequence (like a range) and execute a block of code for each element in that sequence.
    for p in [(r.x-1, r.y), (r.x+1, r.y), (r.x, r.y-1), (r.x, r.y+1)]:
        surf.blit(os, p)
    # [HARD] Creates an outline by drawing the outline-colored text (os) at four offset positions around the main text (left, right, up, down). Loops through these positions to blit (draw) the outline text.

    surf.blit(ts, r)
    # [EASY] Draws the main text (ts) on the surface at the calculated rectangle position.

class Player:
    def __init__(self):
        self.rect = pygame.Rect(WIDTH//2, HEIGHT-floor_height-player_size, player_size, player_size)
        self.dy = 0
        self.on_floor = True
        self.can_double_jump = self.double_jump_available = False
        self.speed_boost = self.shield_active = False
        self.supershield_active = self.opshield_active = self.double_points_active = False
        self.supershield_hits_left = 3
        self.opshield_hits_left = OPSHIELD_HITS
        # [EASY] Initializes a Player object. Sets up a rectangle (rect) for position/size at the center of the screen, above the floor. dy is vertical velocity, on_floor tracks if player is grounded, and various booleans track active powerups. supershield and opshield have hit counters.

    def jump(self):
        if self.on_floor:
            self.dy, self.on_floor, self.double_jump_available = -jump_speed, False, self.can_double_jump
        elif self.double_jump_available:
            self.dy, self.double_jump_available = -jump_speed, False
        # [EASY] Handles player jumping. If on the floor, applies upward velocity (-jump_speed), sets on_floor to False, and enables double jump if available. If in air and double jump is available, performs another jump and disables double jump.

    def move(self, dx):
        self.rect.x = max(0, min(WIDTH-player_size, self.rect.x + dx))
        # [EASY] Moves the player horizontally by dx pixels, ensuring they stay within the screen boundaries (0 to WIDTH-player_size).

    def update(self, floors):
        self.dy += gravity
        self.rect.y += self.dy
        cf = None
        # [EASY] Updates player position: applies gravity to increase downward velocity (dy), moves player vertically by dy, and initializes cf (collided floor) as None.

        for f in floors:
            if self.rect.colliderect(f.rect) and self.dy >= 0 and self.rect.bottom - self.dy <= f.rect.top:
                self.rect.bottom, self.dy, self.on_floor, cf = f.rect.top, 0, True, f
                break
        # [HARD] Checks for collisions with floor rectangles. If the player collides with a floor, is moving downward (dy >= 0), and was above the floor before this update, snaps the player to the floor’s top, resets velocity to 0, sets on_floor to True, and tracks the collided floor (cf).

        else:
            self.on_floor = False
        # [EASY] If no floor collision occurred, sets on_floor to False (player is in the air).

        if cf and self.dy == 0 and cf.damage():
            floors.remove(cf)
        # [HARD] If a floor was collided with, velocity is 0 (player landed), and the floor’s damage() method returns True (health <= 0), removes the floor from the floors list.

        if self.rect.y > HEIGHT - floor_height - player_size:
            self.rect.y, self.dy, self.on_floor = HEIGHT - floor_height - player_size, 0, True
        # [EASY] If the player falls below the ground level, snaps them back to the ground, resets velocity, and sets on_floor to True.

        self.rect.x = max(0, min(WIDTH - player_size, self.rect.x))
        # [EASY] Ensures the player’s x-position stays within screen boundaries, preventing them “‘from moving off-screen.

    def draw(self, surf):
        if self.speed_boost:
            gr = player_size * 2
            gl = pygame.Surface((gr * 2, gr * 2), pygame.SRCALPHA)
            pygame.draw.circle(gl, (*SPEED_GLOW_COLOR, 100), (gr, gr), gr)
            surf.blit(gl, (self.rect.centerx - gr, self.rect.centery - gr))
        # [HARD] If speed_boost is active, creates a glowing circle effect around the player. Uses a transparent surface (pygame.SRCALPHA), draws a semi-transparent green circle, and blits it centered on the player.

        if self.opshield_active:
            pygame.draw.ellipse(surf, OPSHIELD_COLOR, self.rect.inflate(18, 18), 5)
        if self.supershield_active:
            pygame.draw.ellipse(surf, SUPER_SHINY_PINK, self.rect.inflate(14, 14), 4)
        if self.shield_active:
            pygame.draw.ellipse(surf, YELLOW, self.rect.inflate(10, 10), 3)
        # [EASY] Draws elliptical outlines around the player if shields are active: opshield (dark pink, thicker), supershield (pink, medium), or regular shield (yellow, thinner). inflate() expands the rectangle for the outline.

        pygame.draw.rect(surf, BLUE, self.rect)
        # [EASY] Draws the player as a blue rectangle on the surface.

class Floor:
    def __init__(self, y):
        self.rect = pygame.Rect(0, y, WIDTH, floor_height)
        self.max_health = 5
        self.health = self.max_health
        # [EASY] Initializes a Floor object with a rectangle spanning the screen width at position y, with a height of floor_height. Sets health to 5.

    def draw(self, surf):
        r = self.health / self.max_health
        c = tuple(int(RED[i] * r + DARK_RED[i] * (1 - r)) for i in range(3))
        # [HARD] Calculates a color for the floor by interpolating between RED and DARK_RED based on health ratio (r). Creates a tuple for RGB values.

        pygame.draw.rect(surf, c, self.rect)
        # [EASY] Draws the floor rectangle with the calculated color.

        w, h = self.rect.width * .3, 6
        x, y = (WIDTH - w) / 2, self.rect.top - h - 4
        pygame.draw.rect(surf, BLACK, (x, y, w, h), 1)
        inner_w = w * (self.health / self.max_health)
        pygame.draw.rect(surf, GREEN, (x + 1, y + 1, inner_w - 2, h - 2))
        # [HARD] Draws a health bar above the floor. Creates a black outline rectangle and a green inner rectangle whose width scales with the floor’s health.

    def damage(self):
        self.health -= 1
        return self.health <= 0
        # [EASY] Reduces floor health by 1 and returns True if health is 0 or less, indicating the floor should be destroyed.

class PowerUp:
    def __init__(self, x, y, pt):
        self.rect = pygame.Rect(x, y, player_size, player_size)
        self.power_type = pt
        self.fall_speed = random.randint(3, 6)
        # [EASY] Initializes a PowerUp with a rectangle at (x, y), a specific powerup type (pt), and a random fall speed between 3 and 6 pixels per frame.

    def apply(self, player, timers):
        d = {
            'double_jump': (('can_double_jump', True), 'double_jump'),
            'speed_boost': (('speed_boost', True), 'speed_boost'),
            'shield': (('shield_active', True), 'shield'),
            'supershield': (('supershield_active', True), 'supershield'),
            'opshield': (('opshield_active', True), 'opshield'),
            'double_points': (('double_points_active', True), 'double_points')
        }
        # [HARD] Defines a dictionary mapping powerup types to tuples containing (attribute to set, value) and timer key.

        if self.power_type in d:
            a, k = d[self.power_type]
            setattr(player, a[0], a[1])
            timers[k] = {'shield': SHIELD_DURATION_FRAMES, 'supershield': SUPERSHIELD_DURATION_FRAMES, 'opshield': OPSHIELD_DURATION_FRAMES}.get(k, POWERUP_DURATION_FRAMES)
            # [HARD] Applies the powerup: sets the player’s attribute (e.g., can_double_jump) to True using setattr(), and sets the timer for the powerup’s duration. Uses specific durations for shields, defaulting to POWERUP_DURATION_FRAMES for others.

            if self.power_type == 'supershield':
                player.supershield_hits_left = 3
            elif self.power_type == 'opshield':
                player.opshield_hits_left = OPSHIELD_HITS
            # [EASY] Resets hit counters for supershield (3 hits) or opshield (6 hits) when those powerups are applied.

    def update(self):
        self.rect.y += self.fall_speed
        # [EASY] Moves the powerup downward by its fall_speed each frame.

    def draw(self, surf):
        pt, r = self.power_type, player_size
        if pt in ("double_jump", "speed_boost", "shield", "double_points"):
            c = {"double_jump": BLUE, "speed_boost": GREEN, "shield": YELLOW, "double_points": DARKER_DOUBLE_POINTS}[pt]
            pygame.draw.rect(surf, c, self.rect)
        # [EASY] Draws basic powerups (double_jump, speed_boost, shield, double_points) as colored rectangles based on their type.

        elif pt in ("supershield", "opshield"):
            c = SUPER_SHINY_PINK if pt == "supershield" else OPSHIELD_COLOR
            glow = pygame.Surface((r * 4, r * 4), pygame.SRCALPHA)
            for i in range(3, 0, -1):
                alpha = (30 if pt == "supershield" else 40) * i
                rect = pygame.Rect(r - i * 6, r - i * 6, self.rect.width + i * 12, self.rect.height + i * 12)
                pygame.draw.rect(glow, (*c[:3], alpha), rect, border_radius=4)
            surf.blit(glow, (self.rect.x - r * 1.5, self.rect.y - r * 1.5))
            pygame.draw.rect(surf, c, self.rect, border_radius=4)
        # [HARD] For supershield or opshield, draws a glowing effect by creating a transparent surface and drawing multiple semi-transparent rectangles with decreasing opacity. Then draws the main powerup rectangle with rounded corners.

        else:
            pygame.draw.rect(surf, WHITE, self.rect)
        # [EASY] Draws any unrecognized powerup as a white rectangle.

class KillBlock:
    def __init__(self, x, y):
        self.size = 60
        self.rect = pygame.Rect(x, y, self.size, self.size)
        self.fall_speed = random.randint(4, 7)
        # [EASY] Initializes a KillBlock with a 60x60 rectangle at (x, y) and a random fall speed between 4 and 7 pixels per frame.

    def update(self):
        self.rect.y += self.fall_speed
        if self.rect.top > HEIGHT:
            self.rect.x = random.randint(0, WIDTH - self.size)
            self.rect.y = -self.size
            self.fall_speed = random.randint(4, 7)
        # [EASY] Moves the kill block downward. If it moves below the screen, repositions it at a random x-coordinate above the screen with a new random fall speed.

    def draw(self, surf):
        pygame.draw.rect(surf, BLACK, self.rect)  # killblocks black as requested
        # [EASY] Draws the kill block as a black rectangle.

def draw_paused_overlay(surf):
    o = pygame.Surface((WIDTH, HEIGHT), pygame.SRCALPHA)
    o.fill(TRANSPARENT_BLACK_180)
    surf.blit(o, (0, 0))
    # [EASY] Creates a semi-transparent black overlay for the pause screen and draws it over the entire game window.

    draw_text_with_outline(surf, "PAUSED", font_xlarge, WHITE, BLACK, WIDTH // 2, HEIGHT // 3)
    draw_text_with_outline(surf, "Press ESC to Resume", font_med, WHITE, BLACK, WIDTH // 2, HEIGHT // 2)
    # [EASY] Draws "PAUSED" and "Press ESC to Resume" text with outlines, centered on the pause screen.

def draw_powerup_timers(surf, timers):
    x, y, bw, bh, g = WIDTH - 160, 10, 120, 16, 6
    # [EASY] Sets up coordinates (x, y), bar width (bw), bar height (bh), and gap (g) for drawing powerup timers.

    for p in timers:
        pygame.draw.rect(surf, BLACK, (x, y, bw, bh))
        mf = {'shield': SHIELD_DURATION_FRAMES, 'supershield': SUPERSHIELD_DURATION_FRAMES, 'opshield': OPSHIELD_DURATION_FRAMES}.get(p, POWERUP_DURATION_FRAMES)
        pr = timers[p] / mf
        clrs = {'speed_boost': GREEN, 'double_jump': BLUE, 'shield': YELLOW, 'supershield': SUPER_SHINY_PINK, 'opshield': OPSHIELD_COLOR, 'double_points': DARKER_DOUBLE_POINTS}
        pygame.draw.rect(surf, clrs.get(p, WHITE), (x + 2, y + 2, int((bw - 4) * pr), bh - 4))
        # [HARD] For each active powerup timer, draws a black outline rectangle and a colored inner rectangle whose width represents the remaining time (pr). Color is based on powerup type.

        lbl = f"{p.replace('_', ' ').title()}: {timers[p] // FPS}s"
        draw_text_with_outline(surf, lbl, font_small, WHITE, BLACK, x + bw // 2, y + 2 + bh // 2)
        y += bh + g
        # [EASY] Draws the powerup’s name and remaining time (in seconds) with an outline, centered in the timer bar. Moves y down for the next timer.

def main():
    state = STATE_MENU
    paused = False
    # [EASY] Initializes the game in the menu state with paused set to False.

    player = Player()
    floors = [Floor(HEIGHT - (i + 1) * floor_height) for i in range(10)]
    powerups = []
    kill_blocks = [KillBlock(random.randint(0, WIDTH - 60), random.randint(-600, -60)) for _ in range(3)]
    # [EASY] Creates a player, 10 floors stacked vertically, an empty powerup list, and 3 kill blocks at random positions above the screen.

    score = score_timer = 0
    ms = base_move_speed
    timers = {k: 0 for k in ['double_jump', 'speed_boost', 'shield', 'supershield', 'opshield', 'double_points']}
    cons_shields = 0
    high_score = 0
    # [EASY] Initializes game variables: score, score_timer (for periodic scoring), movement speed (ms), powerup timers, consecutive shields counter, and high score.

    btn = pygame.Rect(WIDTH // 2 - 100, HEIGHT // 2 - 25, 200, 50)
    # [EASY] Defines a rectangle for the "PLAY GAME" button on the menu screen.

    def reset_game():
        nonlocal player, floors, powerups, kill_blocks, score, score_timer, ms, timers, cons_shields
        player = Player()
        floors = [Floor(HEIGHT - (i + 1) * floor_height) for i in range(10)]
        powerups = []
        kill_blocks = [KillBlock(random.randint(0, WIDTH - 60), random.randint(-600, -60)) for _ in range(3)]
        score = score_timer = 0
        ms = base_move_speed
        timers = {k: 0 for k in timers}
        cons_shields = 0
        # [EASY] Resets the game by reinitializing the player, floors, powerups, kill blocks, and game variables to their starting values.

    while True:
        clock.tick(FPS)
        # [EASY] Limits the game to run at 60 frames per second for consistent timing.

        for e in pygame.event.get():
            if e.type == pygame.QUIT:
                pygame.quit()
                sys.exit()
            # [EASY] Checks for the window close event and exits the game cleanly.

            if state == STATE_MENU:
                if e.type == pygame.MOUSEBUTTONDOWN and e.button == 1 and btn.collidepoint(pygame.mouse.get_pos()):
                    reset_game()
                    state = STATE_PLAYING
                    paused = False
                elif e.type == pygame.KEYDOWN and e.key == pygame.K_SPACE:
                    reset_game()
                    state = STATE_PLAYING
                    paused = False
                # [EASY] In the menu state, starts the game (resets and switches to PLAYING state) on left-clicking the play button or pressing the spacebar.

            elif state == STATE_PLAYING:
                if e.type == pygame.KEYDOWN:
                    if not paused and e.key in (pygame.K_SPACE, pygame.K_w, pygame.K_UP):
                        player.jump()
                    elif e.key == pygame.K_ESCAPE:
                        paused = not paused
                # [EASY] In the playing state, triggers a jump if space, W, or up arrow is pressed (unless paused), and toggles pause with the ESC key.

            elif state == STATE_GAMEOVER and e.type == pygame.KEYDOWN and e.key == pygame.K_r:
                state = STATE_MENU
                # [EASY] In the game over state, pressing R returns to the menu.

        keys = pygame.key.get_pressed()
        if state == STATE_PLAYING and not paused:
            dx = (keys[pygame.K_d] or keys[pygame.K_RIGHT]) * ms - (keys[pygame.K_a] or keys[pygame.K_LEFT]) * ms
            if timers['speed_boost'] > 0:
                dx *= 2
            player.move(dx)
            # [EASY] Calculates horizontal movement (dx) based on A/D or left/right arrow keys. Doubles speed if speed_boost is active, then moves the player.

            player.update(floors)
            # [EASY] Updates the player’s position and checks for floor collisions.

            if random.randint(1, 200) == 1:
                powerups.append(PowerUp(random.randint(0, WIDTH - player_size), -player_size, random.choices(["double_jump", "speed_boost", "shield", "supershield", "opshield", "double_points"], weights=[20, 20, 20, 1, 0.05, 5])[0]))
            # [HARD] Spawns a new powerup 1/200 frames (rarely) at a random x-position above the screen. Uses weighted random selection to choose the powerup type, with supershield and opshield being rarer.

            for pu in powerups[:]:
                pu.update()
                if pu.rect.top > HEIGHT:
                    pu.rect.x = random.randint(0, WIDTH - player_size)
                    pu.rect.y = -player_size
                    pu.fall_speed = random.randint(3, 6)
                # [EASY] Updates each powerup’s position. If it falls below the screen, repositions it above with a new random x-coordinate and fall speed.

                elif player.rect.colliderect(pu.rect):
                    pu.apply(player, timers)
                    score += 2 if player.double_points_active else 1
                    if pu.power_type == "shield":
                        cons_shields += 1
                        if cons_shields == 6:
                            player.opshield_active = True
                            player.opshield_hits_left = OPSHIELD_HITS
                            timers['opshield'] = OPSHIELD_DURATION_FRAMES
                            cons_shields = 0
                    elif pu.power_type == "opshield":
                        cons_shields = 0
                    else:
                        cons_shields = 0
                    powerups.remove(pu)
                # [HARD] If the player collides with a powerup, applies its effect, adds 1 or 2 to the score (based on double_points), and tracks consecutive shields. If 6 shields are collected consecutively, grants an opshield. Resets shield counter for opshield or other powerups. Removes the powerup.

            for kb in kill_blocks:
                kb.update()
                if player.rect.colliderect(kb.rect):
                    if player.opshield_active:
                        player.opshield_hits_left -= 1
                        if player.opshield_hits_left <= 0:
                            player.opshield_active = False
                            timers['opshield'] = 0
                        reset_kb = True
                    elif player.supershield_active:
                        player.supershield_hits_left -= 1
                        if player.supershield_hits_left <= 0:
                            player.supershield_active = False
                            timers['supershield'] = 0
                        reset_kb = True
                    elif player.shield_active:
                        player.shield_active = False
                        timers['shield'] = 0
                        reset_kb = True
                    else:
                        if score > high_score:
                            high_score = score
                        state = STATE_GAMEOVER
                        reset_kb = False
                    if reset_kb and state != STATE_GAMEOVER:
                        kb.rect.x = random.randint(0, WIDTH - kb.size)
                        kb.rect.y = -kb.size
                        kb.fall_speed = random.randint(4, 7)
                # [HARD] Updates kill blocks and checks for player collision. If a shield is active, reduces its hit count or deactivates it and resets the kill block. Without a shield, ends the game and updates high_score. Resets kill block position if a shield absorbs the hit.

            for k, t in timers.items():
                if t > 0:
                    timers[k] -= 1
                    if timers[k] == 0:
                        if k == 'double_jump':
                            player.can_double_jump = player.double_jump_available = False
                        elif k == 'speed_boost':
                            player.speed_boost = False
                        elif k == 'shield':
                            player.shield_active = False
                        elif k == 'supershield':
                            player.supershield_active = False
                            player.supershield_hits_left = 3
                        elif k == 'opshield':
                            player.opshield_active = False
                            player.opshield_hits_left = OPSHIELD_HITS
                        elif k == 'double_points':
                            player.double_points_active = False
            # [EASY] Decrements active powerup timers. When a timer reaches 0, deactivates the corresponding powerup and resets related player attributes.

            score_timer += 1
            if score_timer >= 10:
                score += (2 if player.double_points_active else 1)
                score_timer = 0
            # [EASY] Increments score_timer each frame. Every 10 frames, adds 1 or 2 to the score (based on double_points) and resets the timer.

        screen.fill(WHITE)
        # [EASY] Clears the screen by filling it with white before drawing the next frame.

        if state == STATE_MENU:
            draw_text_with_outline(screen, "Cube Runner", font_large, BLACK, WHITE, WIDTH // 2, HEIGHT // 4)
            pygame.draw.rect(screen, GRAY, btn)
            draw_text_with_outline(screen, "PLAY GAME", font_med, BLACK, WHITE, WIDTH // 2, HEIGHT // 2 - 12)
            draw_text_with_outline(screen, "Move: A/D or Arrows, Jump: W/Up/Space", font_small, BLACK, WHITE, WIDTH // 2, HEIGHT // 2 + 50)
            draw_text_with_outline(screen, "Avoid falling red blocks! Collect powerups!", font_small, BLACK, WHITE, WIDTH // 2, HEIGHT // 2 + 80)
            draw_text_with_outline(screen, f"High Score: {high_score}", font_med, BLACK, WHITE, WIDTH // 2, HEIGHT // 2 + 140)
            draw_text_with_outline(screen, "Made By: Abdullah ALKhaldi", font_small, BLACK, WHITE, WIDTH // 2, HEIGHT // 2 + 180)
            # [EASY] Draws the menu screen with the game title, play button, instructions, and high score.

        elif state == STATE_PLAYING:
            [f.draw(screen) for f in floors]
            [kb.draw(screen) for kb in kill_blocks]
            [pu.draw(screen) for pu in powerups]
            player.draw(screen)
            # [EASY] Draws all floors, kill blocks, powerups, and the player on the screen.

            draw_text_with_outline(screen, f"Score: {score}", font_med, BLACK, WHITE, 60, 20, center=False)
            draw_text_with_outline(screen, f"High Score: {high_score}", font_med, BLACK, WHITE, 60, 50, center=False)
            # [EASY] Draws the current score and high score in the top-left corner.

            act = {k: v for k, v in timers.items() if v > 0}
            if act:
                draw_powerup_timers(screen, act)
            # [HARD] Creates a dictionary of active timers (non-zero) and draws their status bars if any exist.

            if paused:
                draw_paused_overlay(screen)
            # [EASY] Draws the pause overlay if the game is paused.

        elif state == STATE_GAMEOVER:
            draw_text_with_outline(screen, "GAME OVER", font_xlarge, RED, BLACK, WIDTH // 2, HEIGHT // 3)
            draw_text_with_outline(screen, f"Final Score: {score}", font_med, BLACK, WHITE, WIDTH // 2, HEIGHT // 2)
            draw_text_with_outline(screen, f"High Score: {high_score}", font_med, BLACK, WHITE, WIDTH // 2, HEIGHT // 2 + 40)
            draw_text_with_outline(screen, "Press R to Restart", font_med, BLACK, WHITE, WIDTH // 2, HEIGHT // 2 + 80)
            # [EASY] Draws the game over screen with the final score, high score, and restart instructions.

        pygame.display.flip()
        # [EASY] Updates the entire screen to show all drawn elements.

if __name__ == "__main__":
    main()
# [EASY] Checks if the script is run directly (not imported as a module) and calls the main() function to start the game.