Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94a432033f |
+14
-7
@@ -1,4 +1,4 @@
|
|||||||
use bevy::prelude::*;
|
use bevy::{prelude::*};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
@@ -14,16 +14,23 @@ fn main() {
|
|||||||
struct Move;
|
struct Move;
|
||||||
|
|
||||||
fn setup(mut commands: Commands, assets: Res<AssetServer>){
|
fn setup(mut commands: Commands, assets: Res<AssetServer>){
|
||||||
commands.spawn(Camera2d);
|
commands.spawn((Camera2d, Move));
|
||||||
|
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
Sprite::from_image(assets.load("02-00.png")),
|
Sprite::from_image(assets.load("002.png")),
|
||||||
Transform::from_scale(Vec3::splat(0.1)),
|
Transform::from_scale(Vec3::splat(0.25)),
|
||||||
Move,
|
Move,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
commands.spawn((
|
||||||
|
Sprite::from_image(assets.load("000.png")),
|
||||||
|
Transform::from_xyz(0.0, 0.0, -1.)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn moveng(mut m_srite: Query<(&mut Transform, &Move)>) {
|
|
||||||
for (mut tr, _) in m_srite {
|
fn moveng(mut m_sprite: Query<(&mut Transform, &Move)>){
|
||||||
tr.translation.x += 0.1;
|
for (mut tr, _) in m_sprite {
|
||||||
|
tr.translation.x += 0.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user