Adds ball and paddle to scene

master
Joey Pollack 2 years ago
parent 9d0a79f2fd
commit dcbd33e136

BIN
asset src/ball.blend (Stored with Git LFS)

Binary file not shown.

BIN
asset src/paddle.blend (Stored with Git LFS)

Binary file not shown.

BIN
assets/ball.glb (Stored with Git LFS)

Binary file not shown.

BIN
assets/paddle.glb (Stored with Git LFS)

Binary file not shown.

@ -1,5 +1,5 @@
use bevy::{prelude::*, scene::ron::de}; use bevy::prelude::*;
pub struct CorePlugin; pub struct CorePlugin;
@ -11,8 +11,10 @@ impl Plugin for CorePlugin
} }
} }
fn setup(mut commands: Commands, server: Res<AssetServer>) fn setup(mut commands: Commands, server: Res<AssetServer>, mut ambient_light: ResMut<AmbientLight>)
{ {
ambient_light.brightness = 200.0;
// CAMERA // CAMERA
commands.spawn(Camera3dBundle { commands.spawn(Camera3dBundle {
transform: Transform::from_xyz(0.0, 0.0, -25.0).looking_at(Vec3::ZERO, Vec3::Y), transform: Transform::from_xyz(0.0, 0.0, -25.0).looking_at(Vec3::ZERO, Vec3::Y),
@ -21,16 +23,37 @@ fn setup(mut commands: Commands, server: Res<AssetServer>)
// LIGHT // LIGHT
commands.spawn(PointLightBundle { commands.spawn(PointLightBundle {
point_light: PointLight {
intensity: 2_000_000.0,
range: 100.0,
radius: 10.0,
..default()
},
transform: Transform::from_xyz(0.0, 5.0, -5.0), transform: Transform::from_xyz(0.0, 5.0, -5.0),
..default() ..default()
}); });
// BRICK // BRICK
let brick_handle: Handle<Scene> = server.load("brick.glb#Scene0"); let brick_handle: Handle<Scene> = server.load("brick.glb#Scene0");
commands.spawn(SceneBundle { commands.spawn(SceneBundle {
scene: brick_handle, scene: brick_handle,
transform: Transform::from_xyz(0.0, 0.0, 0.0), transform: Transform::from_xyz(0.0, 8.0, 0.0),
.. default()
});
// BALL
let ball_handle: Handle<Scene> = server.load("ball.glb#Scene0");
commands.spawn(SceneBundle {
scene: ball_handle,
transform: Transform::from_xyz(0.0, -7.75, 0.0),
..default()
});
// PADDLE
let paddle_handle: Handle<Scene> = server.load("paddle.glb#Scene0");
commands.spawn(SceneBundle {
scene: paddle_handle,
transform: Transform::from_xyz(0.0, -8.0, 0.0),
..default() ..default()
}); });
} }

@ -1,7 +1,7 @@
use bevy::prelude::*; use bevy::prelude::*;
use hello::hello::HelloPlugin; // use hello::hello::HelloPlugin;
use core::core::CorePlugin; use core::core::CorePlugin;
fn main() fn main()

Loading…
Cancel
Save