.
.
This commit is contained in:
+15
-6
@@ -6,12 +6,8 @@ use x86_64::instructions::interrupts;
|
||||
use alloc::{boxed::Box, string::{String, ToString}, vec, vec::Vec};
|
||||
use vga::writers::{GraphicsWriter, PrimitiveDrawing};
|
||||
|
||||
use crate::{
|
||||
print, println,
|
||||
std::application::{Application, Error},
|
||||
user::bin::*,
|
||||
};
|
||||
use crate::std::io::{Color, write, Screen};
|
||||
use crate::{print, println, std, std::application::{Application, Error}, user::bin::*};
|
||||
use crate::std::io::{Color, write, Screen, Stdin};
|
||||
use crate::std::random::Random;
|
||||
use crate::user::bin::gigachad_detector::GigachadDetector;
|
||||
use crate::user::bin::grapher::Grapher;
|
||||
@@ -123,6 +119,19 @@ async fn exec() -> Result<(), Error> {
|
||||
gigachad_detector.run(args).await?;
|
||||
}
|
||||
|
||||
"wait" => {
|
||||
use std::time::wait;
|
||||
|
||||
for _ in 0..20 {
|
||||
wait(0.5);
|
||||
let key = Stdin::try_keystroke();
|
||||
println!("waited {}", match key {
|
||||
Some(c) => c,
|
||||
None => '_',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// direct OS functions (not applications)
|
||||
"echo" => {
|
||||
println!(
|
||||
|
||||
@@ -50,13 +50,13 @@ impl Application for Game {
|
||||
|
||||
'gameloop: loop {
|
||||
|
||||
time::wait(20);
|
||||
time::wait(0.2);
|
||||
|
||||
// if let Some(c) = Stdin::try_keystroke() {
|
||||
// self.mv = c;
|
||||
// }
|
||||
if let Some(c) = Stdin::try_keystroke() {
|
||||
self.mv = c;
|
||||
}
|
||||
|
||||
self.mv = Stdin::keystroke().await;
|
||||
//self.mv = Stdin::keystroke().await;
|
||||
|
||||
match self.mv {
|
||||
'w' => self.head.y -= 1,
|
||||
|
||||
Reference in New Issue
Block a user