Exemplo n.º 1
0
background_line_width = 1

display.init(screen_width, screen_height, cell_size, menu_width, playfield_w, playfield_h, background_line_width)
events.init()

# TODO: iterate for every level
current_level = levels.level_1
current_waves_list = levels.level_1_waves

level_number = 1
wave_number = 0
heart_number = 20
kill_counter = 0
heart_max = heart_number
money = Resource()
money.gain(350)
victorious = False

# clean up the level
for i in range(len(current_level) - 1):
    current_level[i] = Terrain(current_level[i])

# locations for towers, color can be changed by changing the terrain type
cells = []
for i in range(playfield_w * playfield_h):
    x = int(i % playfield_w) * cell_size + menu_width
    y = int(i / playfield_w) * cell_size
    cells.append(Cell(i, x, y, cell_size, current_level[i]))
    display.register(cells[i])

# the path of positions that enemies must follow