very simple game base
All checks were successful
Build Bevy Game (Linux) / build (push) Successful in 19m17s
All checks were successful
Build Bevy Game (Linux) / build (push) Successful in 19m17s
This commit is contained in:
parent
1d5ef2006a
commit
27da890604
5 changed files with 32 additions and 42 deletions
19
src/kirby.rs
Normal file
19
src/kirby.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use bevy::{prelude::*, render::renderer};
|
||||
|
||||
#[derive(Component)]
|
||||
#[require(Transform, Sprite)]
|
||||
pub struct Kirby();
|
||||
|
||||
pub fn kirby_spawn(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||
let sprite = Sprite::from_image(asset_server.load("sprites/kirby.png"));
|
||||
commands.spawn((Kirby(), Transform::from_xyz(0.0, 0.0, 0.0), sprite));
|
||||
}
|
||||
|
||||
pub fn kirby_input(
|
||||
keyboard_input: Res<ButtonInput<KeyCode>>,
|
||||
// query: Query<&mut Transform, With<Kirby>>,
|
||||
) {
|
||||
if keyboard_input.pressed(KeyCode::Space) {
|
||||
println!("SUCKING");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue