mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-14 19:55:02 +01:00
22 lines
524 B
Rust
22 lines
524 B
Rust
use sfml::graphics::{RenderTarget, RenderWindow, Sprite};
|
|
|
|
use crate::{math::WorldPos, res::Res, world::World};
|
|
|
|
pub struct GameState {
|
|
camera_offset: WorldPos,
|
|
world: World,
|
|
}
|
|
impl GameState {
|
|
pub(crate) fn draw_world(&mut self, rw: &mut RenderWindow, res: &Res) {
|
|
rw.draw(&Sprite::with_texture(&res.tile_atlas));
|
|
}
|
|
}
|
|
|
|
impl Default for GameState {
|
|
fn default() -> Self {
|
|
Self {
|
|
camera_offset: WorldPos { x: 0, y: 0 },
|
|
world: Default::default(),
|
|
}
|
|
}
|
|
}
|