fireboy watergirl moment

This commit is contained in:
gallant 2022-05-21 14:01:50 -05:00
parent 961b455c40
commit 1b890d73eb

View file

@ -41,6 +41,10 @@ fn main() {
} }
for key in keys { for key in keys {
let state = match key {
Scancode::Left | Scancode::Right => 0,
_ => 2,
};
let offset = match key { let offset = match key {
Scancode::Escape => { Scancode::Escape => {
game.terminate(); game.terminate();
@ -53,17 +57,9 @@ fn main() {
_ => (0, 0), _ => (0, 0),
}; };
let mut spriteindex = sprites.get(0).unwrap(); let spriteindex = sprites.get_mut(state).unwrap();
/*
*/ spriteindex.translate(offset);
/*pub const fn unwrap(self) -> T {
match self {
Some(val) => val,
None => panic("called `Option::unwrap()` on a `None` value"),
}
}*/
//spriteindex.translate(offset);
} }
ctx.set_background_colour( 129, 201, i); ctx.set_background_colour( 129, 201, i);