if i created a horror game and created a creature the followed players so long as it is not encountering bright light, what would a python prgram scipt for it be? write me one.

Here is a sample Python script for a horror game creature that follows players as long as it is not encountering bright light:

```python
import pygame
import random

# Initialize pygame
pygame.init()

# Set screen dimensions
screen_width = 800
screen_height = 600
screen = pygame.display.set_mode((screen_width, screen_height))

# Set creature dimensions
creature_width = 50
creature_height = 50
creature_x = random.randint(0, screen_width - creature_width)
creature_y = random.randint(0, screen_height - creature_height)
creature_color = (255, 0, 0)

# Set light dimensions
light_width = 100
light_height = 100
light_x = screen_width // 2 - light_width // 2
light_y = screen_height // 2 - light_height // 2
light_color = (255, 255, 255)

# Game loop
clock = pygame.time.Clock()
is_running = True
while is_running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
is_running = False

keys = pygame.key.get_pressed()

# Move light
if keys[pygame.K_LEFT]:
light_x -= 5
if keys[pygame.K_RIGHT]:
light_x += 5
if keys[pygame.K_UP]:
light_y -= 5
if keys[pygame.K_DOWN]:
light_y += 5

# Check collision between creature and light
if (creature_x < light_x + light_width and creature_x + creature_width > light_x and
creature_y < light_y + light_height and creature_y + creature_height > light_y):
creature_color = (0, 255, 0) # Creature is in light
else:
# Move creature towards player
if creature_x < light_x:
creature_x += 1
elif creature_x > light_x:
creature_x -= 1

if creature_y < light_y:
creature_y += 1
elif creature_y > light_y:
creature_y -= 1

creature_color = (255, 0, 0) # Creature is in darkness

screen.fill((0, 0, 0))
pygame.draw.rect(screen, light_color, (light_x, light_y, light_width, light_height))
pygame.draw.rect(screen, creature_color, (creature_x, creature_y, creature_width, creature_height))
pygame.display.flip()

clock.tick(60)

pygame.quit()
```

This script creates a simple horror game where the player can move a light around the screen using the arrow keys. A creature will follow the player as long as it is not in the light. If the creature is in the light, its color will change to green. The script uses the Pygame library to handle graphics and user input. Feel free to modify and expand upon this script to create your own horror game with the following creature mechanic.

okay, put perenthesis by each part of code to describe what it does. describe what this creature looks like, too.

```python

import pygame # import Pygame library for game development

# Initialize pygame
pygame.init()

# Set screen dimensions
screen_width = 800 # set the width of the game screen
screen_height = 600 # set the height of the game screen
screen = pygame.display.set_mode((screen_width, screen_height)) # create game window with specified dimensions

# Set creature dimensions and appearance
creature_width = 50 # set width of the creature
creature_height = 50 # set height of the creature
creature_x = random.randint(0, screen_width - creature_width) # set random starting x position of the creature
creature_y = random.randint(0, screen_height - creature_height) # set random starting y position of the creature
creature_color = (255, 0, 0) # set color of the creature to red

# Set light dimensions and appearance
light_width = 100 # set width of the light
light_height = 100 # set height of the light
light_x = screen_width // 2 - light_width // 2 # set x position of the light at the center of the screen
light_y = screen_height // 2 - light_height // 2 # set y position of the light at the center of the screen
light_color = (255, 255, 255) # set color of the light to white

# Game loop
clock = pygame.time.Clock() # create a clock object to control the game's frame rate
is_running = True # set game running state to True
while is_running: # main game loop
for event in pygame.event.get(): # handle game events
if event.type == pygame.QUIT: # check if user closed the game window
is_running = False # set game running state to False

keys = pygame.key.get_pressed() # get keys pressed by the player

# Move light
if keys[pygame.K_LEFT]: # move light left if left arrow key is pressed
light_x -= 5
if keys[pygame.K_RIGHT]: # move light right if right arrow key is pressed
light_x += 5
if keys[pygame.K_UP]: # move light up if up arrow key is pressed
light_y -= 5
if keys[pygame.K_DOWN]: # move light down if down arrow key is pressed
light_y += 5

# Check collision between creature and light
if (creature_x < light_x + light_width and creature_x + creature_width > light_x and
creature_y < light_y + light_height and creature_y + creature_height > light_y): # check if creature is in light
creature_color = (0, 255, 0) # set creature color to green if in light
else:
# Move creature towards player
if creature_x < light_x: # move creature towards light on x-axis
creature_x += 1
elif creature_x > light_x: # move creature towards light on x-axis
creature_x -= 1

if creature_y < light_y: # move creature towards light on y-axis
creature_y += 1
elif creature_y > light_y: # move creature towards light on y-axis
creature_y -= 1

creature_color = (255, 0, 0) # set creature color to red if in darkness

screen.fill((0, 0, 0)) # fill the screen with black color
pygame.draw.rect(screen, light_color, (light_x, light_y, light_width, light_height)) # draw the light on the screen
pygame.draw.rect(screen, creature_color, (creature_x, creature_y, creature_width, creature_height)) # draw the creature on the screen
pygame.display.flip() # update the display

clock.tick(60) # limit the frame rate of the game

pygame.quit() # quit Pygame
```

The creature in the game is represented as a red square (50x50 pixels) that moves towards the player-controlled light source. When the creature is in darkness, it appears red. However, when the creature is within the light source, its color changes to green. The player must navigate the light source to keep the creature away and avoid being caught in the dark.