added async stone detection thread
This commit is contained in:
12
litris.py
12
litris.py
@@ -96,7 +96,7 @@ class Litris(GameBase):
|
||||
print("offset column:", offset_col)
|
||||
self.field.drop(current_tetromino, column)
|
||||
self.move_stone(column - offset_col, rotation)
|
||||
for i in range(1,8,1):
|
||||
for i in range(1, 10, 1):
|
||||
self.keyboard.press(Key.down)
|
||||
self.keyboard.release(Key.down)
|
||||
print("direction pressed: drop down")
|
||||
@@ -253,23 +253,23 @@ class Litris(GameBase):
|
||||
else:
|
||||
return None
|
||||
|
||||
def move_stone(self, col_movement, rotation, move_mode):
|
||||
def move_stone(self, col_movement, rotation):
|
||||
if col_movement is None:
|
||||
return
|
||||
|
||||
if move_mode == 1:
|
||||
if self.move_mode == 1:
|
||||
down = Key.down
|
||||
left = Key.left
|
||||
right = Key.right
|
||||
elif move_mode == 2:
|
||||
elif self.move_mode == 2:
|
||||
down = Key.left
|
||||
left = Key.up
|
||||
right = Key.down
|
||||
elif move_mode == 3:
|
||||
elif self.move_mode == 3:
|
||||
down = Key.up
|
||||
left = Key.right
|
||||
right = Key.left
|
||||
elif move_mode == 4:
|
||||
elif self.move_mode == 4:
|
||||
down = Key.right
|
||||
left = Key.down
|
||||
right = Key.up
|
||||
|
||||
Reference in New Issue
Block a user