We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7f2637 commit b487facCopy full SHA for b487fac
src/main.rs
@@ -1,12 +1,34 @@
1
use bevy::prelude::*;
2
3
+const SNAKE_HEAD_COLOR: Color = Color::rgb(0.7, 0.7, 0.7);
4
+
5
+#[derive(Component)]
6
+struct SnakeHead;
7
8
fn setup_camera(mut commands: Commands) {
9
commands.spawn_bundle(OrthographicCameraBundle::new_2d());
10
}
11
12
+fn spawn_snake(mut commands: Commands) {
13
+ commands
14
+ .spawn_bundle(SpriteBundle {
15
+ sprite: Sprite {
16
+ color: SNAKE_HEAD_COLOR,
17
+ ..default()
18
+ },
19
+ transform: Transform {
20
+ scale: Vec3::new(10.0, 10.0, 10.0),
21
22
23
24
+ })
25
+ .insert(SnakeHead);
26
+}
27
28
fn main() {
29
App::new()
30
.add_startup_system(setup_camera)
31
+ .add_startup_system(spawn_snake)
32
.add_plugins(DefaultPlugins)
33
.run();
34
0 commit comments