mirror of
https://github.com/mii443/rustris.git
synced 2025-08-23 00:35:40 +00:00
fix check clear
This commit is contained in:
@ -5,9 +5,9 @@ mod rustris;
|
|||||||
mod mino_rotation;
|
mod mino_rotation;
|
||||||
mod game_status;
|
mod game_status;
|
||||||
mod super_rotation;
|
mod super_rotation;
|
||||||
use std::{io::stdout, process::exit, sync::{Arc, Mutex}, thread, time::Duration};
|
use std::{io::stdout, sync::{Arc, Mutex}, thread, time::Duration};
|
||||||
|
|
||||||
use crossterm::{cursor, event::{Event, KeyCode, KeyEvent, KeyModifiers, read}, execute, style::{Color, Print, ResetColor, SetBackgroundColor, SetForegroundColor}, terminal::{self, Clear, ClearType, enable_raw_mode}};
|
use crossterm::{cursor, event::{Event, KeyCode, KeyEvent, KeyModifiers, read}, execute, style::{Color, Print, ResetColor, SetBackgroundColor}, terminal::{self, Clear, ClearType, enable_raw_mode}};
|
||||||
use game_data::GameData;
|
use game_data::GameData;
|
||||||
use game_status::GameStatus;
|
use game_status::GameStatus;
|
||||||
use mino_rotation::MinoRotation;
|
use mino_rotation::MinoRotation;
|
||||||
@ -164,6 +164,8 @@ fn main() {
|
|||||||
} else {
|
} else {
|
||||||
rustris_rc.place_control_mino(Block::Block);
|
rustris_rc.place_control_mino(Block::Block);
|
||||||
rustris_rc.next_mino();
|
rustris_rc.next_mino();
|
||||||
|
rustris_rc.check_clear();
|
||||||
|
|
||||||
ground_flag = false;
|
ground_flag = false;
|
||||||
*control_count_rc.lock().unwrap() = 0;
|
*control_count_rc.lock().unwrap() = 0;
|
||||||
before_control_count = 0;
|
before_control_count = 0;
|
||||||
@ -235,6 +237,7 @@ fn main() {
|
|||||||
modifiers: KeyModifiers::NONE
|
modifiers: KeyModifiers::NONE
|
||||||
}) => {
|
}) => {
|
||||||
let mut rustris = rustris.lock().unwrap();
|
let mut rustris = rustris.lock().unwrap();
|
||||||
|
|
||||||
if let Some(holding) = rustris.game_data.hold_mino.clone() {
|
if let Some(holding) = rustris.game_data.hold_mino.clone() {
|
||||||
let control_tmp = rustris.game_data.control_mino.clone();
|
let control_tmp = rustris.game_data.control_mino.clone();
|
||||||
rustris.game_data.control_mino = Some(holding);
|
rustris.game_data.control_mino = Some(holding);
|
||||||
|
Reference in New Issue
Block a user