initial toying around with bevy
This commit is contained in:
commit
0e1061609c
4 changed files with 3295 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/target
|
3263
Cargo.lock
generated
Normal file
3263
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
9
Cargo.toml
Normal file
9
Cargo.toml
Normal file
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "pix_space"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
bevy = "0.7" # make sure this is the latest version
|
22
src/main.rs
Normal file
22
src/main.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
use bevy::prelude::*;
|
||||
|
||||
#[derive(Component)]
|
||||
struct Position { x: f32, y:f32}
|
||||
|
||||
fn hello_world() {
|
||||
println!("Hello World!");
|
||||
}
|
||||
|
||||
|
||||
fn print_position_system(query : Query<&Transform>) {
|
||||
for transform in query.iter() {
|
||||
println!("position {:?}", transform.translation)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_system(hello_world)
|
||||
.run();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue