Browse Source

Merge branch 'master' of blinkenbunt:gitrepos/blup3

master
Fr3deric 8 years ago committed by Frederic
parent
commit
becd8f5b2a
  1. 35
      gamemenu.py

35
gamemenu.py

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

Loading…
Cancel
Save