|
|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
|
|
|
|
|
use bevy::{prelude::*, scene::ron::de};
|
|
|
|
|
use bevy::prelude::*;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
commands.spawn(Camera3dBundle {
|
|
|
|
|
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
|
|
|
|
|
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),
|
|
|
|
|
..default()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// BRICK
|
|
|
|
|
let brick_handle: Handle<Scene> = server.load("brick.glb#Scene0");
|
|
|
|
|
|
|
|
|
|
commands.spawn(SceneBundle {
|
|
|
|
|
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()
|
|
|
|
|
});
|
|
|
|
|
}
|