-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotes_and_unused_staff
78 lines (65 loc) · 2.34 KB
/
notes_and_unused_staff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
def move(current_left, current_top):
"""Provides moving, rotating and speed up falling down
of current bufor"""
events = pygame.event.get()
for event in events:
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_LEFT:
return current_left + (-1), current_top
if event.key == pygame.K_RIGHT:
return current_left + 1, current_top
if event.key == pygame.K_DOWN:
return current_left, current_top+1
return current_left
def set_gameboard():
"""Setting -1 to left, bottom and right lines to detect collision
with bufor and boundaries of board."""
for i in range(BOARD_COLUMNS):
gameboard[BOARD_ROWS-1][i] = -1
for i, row in enumerate(gameboard):
for j, elem in enumerate(row):
print(gameboard[i][j], end=" ")
print("")
pygame.draw.rect(
screen,
colors["red"],
(game_board_coons["left"],
game_board_coons["top"],
board_width - 2 * block_size,
board_height - block_size)
)
Do testów:
· wziąć funkcje z całego modułu
· zestaw danych wejsciowych i oczekiwanch wyjściowych
· w testach odpalam te funkcje z dany we.
·
-> change to PyGame version delay() or
# # to test evaluator - will be deleted soon...
# testing_board = gameboard.Gameboard()
# testing_board.fields[21][1] = 2
# testing_board.fields[21][2] = 2
# testing_board.fields[21][3] = 2
# testing_board.fields[21][4] = 2
# testing_board.fields[21][5] = 2
# testing_board.fields[21][6] = 2
# testing_board.fields[20][1] = 2
# testing_board.fields[20][2] = 2
# testing_board.fields[20][3] = 2
# testing_board.fields[0][9] = 2
# test_teto = tetromino.Tetromino("I", times_rotated=2, x=3)
# def pre_configure_window():
# """Configure whole stuff around game"""
# pygame.display.set_caption("Tetris by Bartq98")
# screen = pygame.display.set_mode((config.SCREEN_WIDTH, config.SCREEN_HEIGHT))
# screen.fill(config.Color.DARKRED.value)
# return screen
# screen = pre_configure_window()
# pygame.init()
# score = Evaluator.calculate(testing_board, test_teto)
# score2 = Evaluator.test_all_cases(testing_board)
# test_teto = Evaluator.generate_tetromino(testing_board, 4)
# print(test_teto.buffer)
# print(score)
# testing_board.draw_gameboard(screen)
# pygame.display.update()
# time.sleep(30)