|
|
@ -97,13 +97,21 @@ select_game = [ |
|
|
|
[0,0,1,1,0,0,1,0,1,0,1,0,0,0,1,0,1,1,0], |
|
|
|
[0,0,1,1,0,0,1,0,1,0,1,0,0,0,1,0,1,1,0], |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
player2 = [ |
|
|
|
player = [ |
|
|
|
[0,1,1,1,0,0,1,1,1,0,0,0,1,1,0], |
|
|
|
[1,1,0,0,1,0,0,0,1,0,0,1,0,1,0,1,1,0,1,1,0], |
|
|
|
[1,0,0,0,1,0,1,0,0,1,0,1,0,0,1], |
|
|
|
[1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1], |
|
|
|
[0,0,0,1,0,0,1,0,0,1,0,0,0,1,0], |
|
|
|
[1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,1,0], |
|
|
|
[0,0,1,0,0,0,1,1,1,0,0,0,1,0,0], |
|
|
|
[1,0,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1], |
|
|
|
[0,1,0,0,0,0,1,0,0,0,0,0,0,0,0], |
|
|
|
[1,0,0,0,1,1,0,1,0,1,0,0,1,0,0,1,1,0,1,0,1], |
|
|
|
[1,1,1,1,1,0,1,0,0,0,0,0,1,0,0], |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
two = [ |
|
|
|
|
|
|
|
[0,1,1,1,0,0,0,1,1,0], |
|
|
|
|
|
|
|
[1,0,0,0,1,0,1,0,0,1], |
|
|
|
|
|
|
|
[0,0,0,1,0,0,0,0,1,0], |
|
|
|
|
|
|
|
[0,0,1,0,0,0,0,1,0,0], |
|
|
|
|
|
|
|
[0,1,0,0,0,0,0,0,0,0], |
|
|
|
|
|
|
|
[1,1,1,1,1,0,0,1,0,0], |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
def copy_bitmap(bitmap, frame, color, xoffs=0, yoffs=0): |
|
|
|
def copy_bitmap(bitmap, frame, color, xoffs=0, yoffs=0): |
|
|
@ -125,10 +133,15 @@ def create_init_screen(dimension): |
|
|
|
def create_2player_screen(dimension): |
|
|
|
def create_2player_screen(dimension): |
|
|
|
frame = blup.frame.Frame(dimension) |
|
|
|
frame = blup.frame.Frame(dimension) |
|
|
|
|
|
|
|
|
|
|
|
xoffs = (dimension.size()[0]-len(player2[0]))//2 |
|
|
|
xoffs = (dimension.size()[0]-len(player[0]))//2 |
|
|
|
yoffs = (dimension.size()[1]-len(player2))//2 |
|
|
|
yoffs = 1 |
|
|
|
|
|
|
|
color = (0, 255, 0) |
|
|
|
|
|
|
|
copy_bitmap(player, frame, color, xoffs, yoffs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xoffs = (dimension.size()[0]-len(two[0]))//2 |
|
|
|
|
|
|
|
yoffs += 1+len(two) |
|
|
|
color = (0, 255, 0) |
|
|
|
color = (0, 255, 0) |
|
|
|
copy_bitmap(player2, frame, color, xoffs, yoffs) |
|
|
|
copy_bitmap(two, frame, color, xoffs, yoffs) |
|
|
|
|
|
|
|
|
|
|
|
return frame |
|
|
|
return frame |
|
|
|
|
|
|
|
|
|
|
@ -315,7 +328,7 @@ if __name__ == '__main__': |
|
|
|
|
|
|
|
|
|
|
|
init_frame = create_init_screen(dim) |
|
|
|
init_frame = create_init_screen(dim) |
|
|
|
out.sendFrame(init_frame) |
|
|
|
out.sendFrame(init_frame) |
|
|
|
time.sleep(2) |
|
|
|
time.sleep(1) |
|
|
|
games = Game.__subclasses__() |
|
|
|
games = Game.__subclasses__() |
|
|
|
game_idx = 0 |
|
|
|
game_idx = 0 |
|
|
|
old_idx = -1 |
|
|
|
old_idx = -1 |
|
|
|