# Implementation of Inkspill in Minecraft using the Python API
# Adapts the original PyGame code from Al Sweigart to Minecraft display
# Keeps the same "Simplified BSD" license
#
# Original header comment :
#
# Ink Spill (a Flood It clone)
# http://inventwithpython.com/pygame
# By Al Sweigart al@inventwithpython.com
# Released under a "Simplified BSD" license

import sys
import random, copy
from time import sleep
from mcpi.vec3 import Vec3
from mcpi.block import WOOL, GLOWING_OBSIDIAN, GLASS, DIAMOND_BLOCK, TNT, AIR
from mcpi.minecraft import Minecraft
from blockData import COLOUR_NAME_TO_ID as woolCol

# There are different number of boxes, and
# life depending on the "board size" setting selected.

SMALLBOARDSIZE  = 6 # size is in boxes
MEDIUMBOARDSIZE = 17
LARGEBOARDSIZE  = 30

SMALLMAXLIFE  = 10 # number of turns
MEDIUMMAXLIFE = 30
LARGEMAXLIFE  = 64


EASY   = 0   # arbitrary but unique value
MEDIUM = 1   # arbitrary but unique value
HARD   = 2   # arbitrary but unique value

#The pause between each iteration of the game loop
POLL_TIME = 1.0/60.0

difficulty  = MEDIUM # game starts in "medium" mode
maxLife     = MEDIUMMAXLIFE
boardWidth  = MEDIUMBOARDSIZE
boardHeight = MEDIUMBOARDSIZE

# The first color in each scheme is the background color, the next six are the palette colors.
COLORSCHEMES = (
               (woolCol["red"], woolCol["lime"], woolCol["blue"], woolCol["yellow"], woolCol["orange"], woolCol["magenta"]),