Exemplo n.º 1
0
def fill_empty_space(match_length, x, y):
    from Main import make_element
    random_order = list(range(0, len(Globals.sprite_paths)))
    random.shuffle(random_order)
    for r in random_order:
        if (check_adjacent_count(r, x, y, match_length) < match_length):
            Gameboard[x][y] = make_element(r)
            return True
    return False
Exemplo n.º 2
0
def plant_seed(pos, index):
    global Gameboard
    from Main import make_element
    if not Seeds.can_plant(index):
        return
    x = pos[0]
    y = pos[1]
    obj = make_element(index)
    obj.growth_turn = Globals.current_turn + Globals.growth_time
    obj.grown = False
    Gameboard[x][y] = obj