diff --git a/assets/font/iosevkalyteweb-regular.subset.woff2 b/assets/font/iosevkalyteweb-regular.subset.woff2 new file mode 100644 index 0000000..1afa631 Binary files /dev/null and b/assets/font/iosevkalyteweb-regular.subset.woff2 differ diff --git a/readme.md b/readme.md index 22130a6..621f895 100644 --- a/readme.md +++ b/readme.md @@ -29,6 +29,8 @@ the heavy-lifting for me _plus_ it's a fun excuse to write more Rust. - In-game editing? - [ ] Enemies - [ ] "Position delta" pathfinding +- [ ] Profiling + - Seems to use a lot of resources doing hardly anything - [ ] Something to slice a tile map into a navigation mesh - Repeatedly? - Navmesh may be super overkill and astar may be sufficient? diff --git a/src/player.rs b/src/player.rs index a163d72..f60fbb9 100644 --- a/src/player.rs +++ b/src/player.rs @@ -1,8 +1,9 @@ -use bevy::prelude::*; +use bevy::{prelude::*, window::PrimaryWindow}; use crate::{ assets::AssetLoader, movement::{Heading, Mover, Speed, Velocity}, + statue::Statue, }; const PLAYER_SPEED: f32 = 100.; @@ -44,6 +45,7 @@ fn controls( mut query: Query<(&mut TextureAtlasSprite, &mut Heading, Entity), With>, input: Res>, assets: Res, + q_windows: Query<&Window, With>, ) { let (mut sprite, mut heading, player_entity) = query.single_mut(); **heading = Vec2::ZERO; @@ -58,6 +60,20 @@ fn controls( .id(); commands.entity(player_entity).push_children(&[child]); } + KeyCode::Key1 => { + if let Some(position) = q_windows.single().cursor_position() { + let spos = position.extend(0.); + commands.spawn(( + Statue, + SpriteSheetBundle { + texture_atlas: assets.images.statue.clone(), + sprite: TextureAtlasSprite::new(0), + transform: Transform::from_translation(spos), + ..Default::default() + }, + )); + } + } _ => {} } }