Compare commits
No commits in common. "04fe103b25adb2e48faa59834850bf367798937b" and "32f6a822a2cb620c1ff52136a8d69ab877894908" have entirely different histories.
04fe103b25
...
32f6a822a2
Binary file not shown.
Before Width: | Height: | Size: 275 B |
@ -18,6 +18,5 @@ fn main() {
|
||||
.insert_resource(ClearColor(Color::rgb(0.0, 0.0, 0.0)))
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_startup_system(setup.system())
|
||||
.add_startup_system(add_player.system())
|
||||
.run();
|
||||
}
|
||||
|
@ -31,23 +31,11 @@ pub fn setup(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_player(
|
||||
mut commands: Commands,
|
||||
asset_server: Res<AssetServer>,
|
||||
mut materials: ResMut<Assets<ColorMaterial>>,
|
||||
) {
|
||||
let player_sprite = materials.add(asset_server.load("marshmallow.png").into());
|
||||
|
||||
pub fn add_player(mut commands: Commands) {
|
||||
commands
|
||||
.spawn()
|
||||
.insert(Player)
|
||||
.insert(Name("Player 1".to_string()))
|
||||
.insert_bundle(SpriteBundle {
|
||||
material: player_sprite,
|
||||
sprite: Sprite::new(Vec2::new(64.0, 64.0)),
|
||||
transform: Transform::from_translation(Vec3::new(0.0, 0.0, 1.0)),
|
||||
..Default::default()
|
||||
});
|
||||
.insert(Name("Player 1".to_string()));
|
||||
}
|
||||
|
||||
pub fn greet_player(
|
||||
|
Loading…
x
Reference in New Issue
Block a user