1
Fork 0

added remaining keys to native client

This commit is contained in:
Andy Killorin 2023-09-13 16:57:36 -05:00
parent f12053d77c
commit d0110bf38f
Signed by: ank
GPG key ID: B6241CA3B552BCA4

View file

@ -1,4 +1,4 @@
use minifb::{Key, ScaleMode, Window, WindowOptions}; use minifb::{Key, ScaleMode, Window, WindowOptions, Scale};
extern crate pirates; extern crate pirates;
use pirates::{WIDTH, HEIGHT}; use pirates::{WIDTH, HEIGHT};
@ -10,6 +10,7 @@ fn main() {
WindowOptions { WindowOptions {
resize: true, resize: true,
scale_mode: ScaleMode::AspectRatioStretch, scale_mode: ScaleMode::AspectRatioStretch,
scale: Scale::X4,
..WindowOptions::default() ..WindowOptions::default()
}, },
) )
@ -43,12 +44,12 @@ fn main() {
window.get_keys().iter().for_each(|key| match key { window.get_keys().iter().for_each(|key| match key {
Key::A => keyboard_input(65), Key::A => keyboard_input(65),
Key::D => keyboard_input(68), Key::D => keyboard_input(68),
_ => (), Key::Equal => keyboard_input(61),
}); Key::Minus => keyboard_input(173),
Key::Up => keyboard_input(38),
window.get_keys_released().iter().for_each(|key| match key { Key::Down => keyboard_input(40),
Key::W => println!("released w!"), Key::Left => keyboard_input(37),
Key::T => println!("released t!"), Key::Right => keyboard_input(39),
_ => (), _ => (),
}); });