here karx
This commit is contained in:
parent
5f1333c22f
commit
961b455c40
|
@ -40,6 +40,7 @@ name = "practice_game"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cat-box",
|
||||
"sdl2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -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"
|
18
src/main.rs
18
src/main.rs
|
@ -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();
|
||||
|
|
Reference in New Issue