here karx

This commit is contained in:
gallant 2022-05-21 13:08:14 -05:00
parent 5f1333c22f
commit 961b455c40
3 changed files with 18 additions and 4 deletions

1
Cargo.lock generated
View File

@ -40,6 +40,7 @@ name = "practice_game"
version = "0.1.0"
dependencies = [
"cat-box",
"sdl2",
]
[[package]]

View File

@ -6,4 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
cat-box = "0.1.6"
cat-box = "0.1.6"
sdl2 = "0.35.2"

View File

@ -1,12 +1,14 @@
use cat_box::{draw_text, Game, Sprite, SpriteCollection, get_keyboard_state};
use std::{thread, time};
use sdl2::keyboard::Scancode;
struct state {
running: bool,
jumping: bool
}
fn main() {
let game = Game::new("Running", 500, 500);
@ -38,7 +40,7 @@ fn main() {
i=200;
}
/*for key in keys {
for key in keys {
let offset = match key {
Scancode::Escape => {
game.terminate();
@ -51,8 +53,18 @@ fn main() {
_ => (0, 0),
};
let mut spriteindex = sprites.get(0).unwrap();
/*
}*/
*/
/*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);
sprites.draw(ctx).unwrap();