mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Use the fact that tris turn into integers nicely
This commit is contained in:
parent
63b0fa63c6
commit
dd2030d354
|
@ -43,18 +43,8 @@ fn main(mut gba: agb::Gba) -> ! {
|
|||
|
||||
loop {
|
||||
input.update();
|
||||
|
||||
match input.x_tri() {
|
||||
Tri::Positive => scroll_x += 1,
|
||||
Tri::Negative => scroll_x -= 1,
|
||||
_ => {}
|
||||
}
|
||||
|
||||
match input.y_tri() {
|
||||
Tri::Positive => scroll_y += 1,
|
||||
Tri::Negative => scroll_y -= 1,
|
||||
_ => {}
|
||||
}
|
||||
scroll_x += input.x_tri() as i32;
|
||||
scroll_y += input.y_tri() as i32;
|
||||
|
||||
let scroll_pos = (scroll_x as i16, scroll_y as i16);
|
||||
bg.set_scroll_pos(scroll_pos.into());
|
||||
|
|
Loading…
Reference in a new issue