mirror of
https://github.com/edg-l/teecity.git
synced 2024-09-18 16:52:21 +00:00
playing with bevy
This commit is contained in:
parent
a101f5b187
commit
3a582c8ec4
3860
Cargo.lock
generated
Normal file
3860
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -5,4 +5,9 @@ edition = "2021"
|
|||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[profile.dev.package."*"]
|
||||
opt-level = 3
|
||||
|
||||
[dependencies]
|
||||
bevy = { version = "0.10.1", features = ["dynamic_linking"] }
|
||||
bevy-inspector-egui = "0.18.3"
|
||||
|
|
2
rust-toolchain.toml
Normal file
2
rust-toolchain.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
[toolchain]
|
||||
channel = "nightly"
|
1
src/entity.rs
Normal file
1
src/entity.rs
Normal file
|
@ -0,0 +1 @@
|
|||
use bevy::prelude::*;
|
18
src/main.rs
18
src/main.rs
|
@ -1,3 +1,19 @@
|
|||
use bevy::prelude::*;
|
||||
use bevy_inspector_egui::quick::WorldInspectorPlugin;
|
||||
|
||||
pub mod entity;
|
||||
pub mod player;
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
App::new()
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_plugin(WorldInspectorPlugin::new())
|
||||
.add_startup_system(player::add_player)
|
||||
.run();
|
||||
}
|
||||
|
||||
fn print_position_system(query: Query<&Transform>) {
|
||||
for transform in &query {
|
||||
println!("position: {:?}", transform.translation);
|
||||
}
|
||||
}
|
||||
|
|
8
src/player.rs
Normal file
8
src/player.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
use bevy::prelude::*;
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Player;
|
||||
|
||||
pub fn add_player(mut commands: Commands) {
|
||||
commands.spawn((Player, Name::new("Ryo"), Transform::default()));
|
||||
}
|
Loading…
Reference in a new issue