balanced the scores

master
kirbylife 2019-11-07 13:36:58 -06:00
parent cda443d33f
commit a8f5c24eaa
1 changed files with 4 additions and 6 deletions

View File

@ -59,8 +59,8 @@ class Afutc:
row = "".join(self.char if field else " " for field in row) row = "".join(self.char if field else " " for field in row)
print(f"{row}") print(f"{row}")
row = "" * (self.board.shape[1]) row = "" * (self.board.shape[1])
# print(f"╚{row}╝") print(f"{row}")
print(str(self.pivot) + "\t" + self.debug) # print(str(self.pivot) + "\t" + self.debug)
except CursesException: except CursesException:
self.pause() self.pause()
@ -74,8 +74,7 @@ class Afutc:
down = self.board[i + 1:] down = self.board[i + 1:]
new_row = np.zeros(shape=(1, WIDTH)) new_row = np.zeros(shape=(1, WIDTH))
self.board = np.concatenate((new_row, upper, down)) self.board = np.concatenate((new_row, upper, down))
if count: self.score += (10 * count) + (5 if count > 3 else 0)
self.score += 100 if count < 3 else 150
# Generate a new piece # Generate a new piece
self.current_move.fill(0.) self.current_move.fill(0.)
new_piece = np.array(choice(PIECES)) new_piece = np.array(choice(PIECES))
@ -152,9 +151,8 @@ class Afutc:
input = self.input input = self.input
self.new_random_piece() self.new_random_piece()
scr.timeout(1000)
while self.running: while self.running:
scr.timeout(1000 - self.score)
scr.refresh() scr.refresh()
char = catch(input, "") char = catch(input, "")
scr.clear() scr.clear()