tetris-terminal 0.0.2a2__tar.gz → 0.0.2a4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tetris-terminal
3
- Version: 0.0.2a2
3
+ Version: 0.0.2a4
4
4
  Summary: A tetris game runs in the terminal
5
5
  Author-email: jayzhu <jay.l.zhu@foxmail.com>
6
6
  Project-URL: homepage, https://github.com/zlh124/tetris-terminal
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tetris-terminal"
7
- version = "0.0.2-alpha2"
7
+ version = "0.0.2-alpha4"
8
8
  description = "A tetris game runs in the terminal"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -459,58 +459,60 @@ class Tetris:
459
459
  if self.frame_timer < 1 / self.fps:
460
460
  return
461
461
  self.frame_timer = 0
462
-
462
+ default_color = curses.color_pair(0)
463
463
  # draw border
464
464
  self.stdscr.move(0, 0)
465
- self.stdscr.addstr("┏")
465
+ self.stdscr.addstr("┏", default_color)
466
466
  self.stdscr.move(0, GAME_WINDOW_SIZE_WIDTH - 1)
467
- self.stdscr.addstr("┓")
467
+ self.stdscr.addstr("┓", default_color)
468
468
  self.stdscr.move(GAME_WINDOW_SIZE_HEIGHT - 1, 0)
469
- self.stdscr.addstr("┗")
469
+ self.stdscr.addstr("┗", default_color)
470
470
  self.stdscr.move(GAME_WINDOW_SIZE_HEIGHT - 1, GAME_WINDOW_SIZE_WIDTH - 1)
471
- self.stdscr.addstr("┛")
471
+ self.stdscr.addstr("┛", default_color)
472
472
 
473
473
  for i in range(1, GAME_WINDOW_SIZE_WIDTH - 1):
474
474
  self.stdscr.move(0, i)
475
- self.stdscr.addstr("━")
475
+ self.stdscr.addstr("━", default_color)
476
476
  self.stdscr.move(GAME_WINDOW_SIZE_HEIGHT - 1, i)
477
- self.stdscr.addstr("━")
477
+ self.stdscr.addstr("━", default_color)
478
478
  for i in range(1, GAME_WINDOW_SIZE_HEIGHT - 1):
479
479
  self.stdscr.move(i, 0)
480
- self.stdscr.addstr("┃")
480
+ self.stdscr.addstr("┃", default_color)
481
481
  self.stdscr.move(i, GAME_WINDOW_SIZE_WIDTH - 1)
482
- self.stdscr.addstr("┃")
482
+ self.stdscr.addstr("┃", default_color)
483
483
 
484
484
  self.stdscr.move(0, 21)
485
- self.stdscr.addstr("┳")
485
+ self.stdscr.addstr("┳", default_color)
486
486
  for i in range(1, 21):
487
487
  self.stdscr.move(i, 21)
488
- self.stdscr.addstr("┃")
488
+ self.stdscr.addstr("┃", default_color)
489
489
  self.stdscr.move(GAME_WINDOW_SIZE_HEIGHT - 1, 21)
490
- self.stdscr.addstr("┻")
490
+ self.stdscr.addstr("┻", default_color)
491
491
 
492
492
  # title
493
493
  self.stdscr.move(3, 28)
494
- self.stdscr.addstr("━┳━┏━━━┳━┏━┓┳┏━╸")
494
+ self.stdscr.addstr("━┳━┏━━━┳━┏━┓┳┏━╸", default_color)
495
495
  self.stdscr.move(4, 28)
496
- self.stdscr.addstr(" ┃ ┣━━ ┃ ┣┳┛┃┗━┓")
496
+ self.stdscr.addstr(" ┃ ┣━━ ┃ ┣┳┛┃┗━┓", default_color)
497
497
  self.stdscr.move(5, 28)
498
- self.stdscr.addstr(" ╹ ┗━━ ╹ ╹┗━┻━━┛")
498
+ self.stdscr.addstr(" ╹ ┗━━ ╹ ╹┗━┻━━┛", default_color)
499
499
 
500
500
  # game info
501
501
  self.stdscr.move(9, 27)
502
- self.stdscr.addstr("Next : ")
502
+ self.stdscr.addstr("Next : ", default_color)
503
503
  for i in range(5):
504
- self.stdscr.addstr(f"{self.bag[i].shape.name} ")
504
+ self.stdscr.addstr(f"{self.bag[i].shape.name} ", default_color)
505
505
 
506
506
  self.stdscr.move(11, 27)
507
- self.stdscr.addstr(f"Score : {self.score}")
507
+ self.stdscr.addstr(f"Score : {self.score}", default_color)
508
508
  self.stdscr.move(13, 27)
509
- self.stdscr.addstr(f"Lines : {self.lines}")
509
+ self.stdscr.addstr(f"Lines : {self.lines}", default_color)
510
510
  self.stdscr.move(15, 27)
511
- self.stdscr.addstr(f"Level : {self.level}")
511
+ self.stdscr.addstr(f"Level : {self.level}", default_color)
512
512
  self.stdscr.move(17, 27)
513
- self.stdscr.addstr(f"Hold : {self.hold.shape.name if self.hold else ''}")
513
+ self.stdscr.addstr(
514
+ f"Hold : {self.hold.shape.name if self.hold else ''}", default_color
515
+ )
514
516
  # board
515
517
  for i in range(20, 40):
516
518
  self.stdscr.move(i - 19, 1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tetris-terminal
3
- Version: 0.0.2a2
3
+ Version: 0.0.2a4
4
4
  Summary: A tetris game runs in the terminal
5
5
  Author-email: jayzhu <jay.l.zhu@foxmail.com>
6
6
  Project-URL: homepage, https://github.com/zlh124/tetris-terminal