gsa/examples/hello_world/main.rs

17 lines
313 B
Rust
Raw Normal View History

2023-07-27 06:43:15 +02:00
use glam::IVec2;
2023-07-27 06:07:34 +02:00
use gsa::{run, Gsa};
struct Game {}
fn init(gsa: &mut Gsa) -> Game {
gsa.sprites[0].tile = 0;
2023-07-27 06:43:15 +02:00
gsa.write_string(3, IVec2 { x: 10, y: 10 }, "Hello World, nyaa~");
2023-07-27 06:07:34 +02:00
Game {}
}
fn update(game: &mut Game, gsa: &mut Gsa) {
gsa.sprites[0].pos += gsa.input_dir();
}
run!(init, update);