spawn pizzeria through defs.txt

This commit is contained in:
yuni 2024-03-20 21:10:57 +01:00
parent 6cf99e6b0a
commit 64ceece0df
2 changed files with 18 additions and 63 deletions

View file

@ -1,13 +1,3 @@
actor -50 0 0 "icarus"
alive "yes"
name "Icarus"
pronoun "it"
chatid "hi_icarus"
scale 1
actor 0 0 0 "alien"
chatid "error"
actor 300000 0 500000 "jupiter"
scale 80000
rotationy -1.40
@ -16,14 +6,27 @@ actor 300000 0 500000 "jupiter"
actor 2000 0 0 "asteroid1"
scale 200
actor -2300 10 0 "pizzeria"
scale 30
rotationy -1
angularmomentum 0 0.0001 0
actor -50 0 0 "suit"
name "Icarus"
chatid "hi_icarus"
alive "yes"
pronoun "it"
actor -2265 10 0 "suit"
name "Space Pizza™"
chatid "pizzeria"
alive "yes"
pronoun "it"
chat "error"
name "ERROR"
msg 0 "INIT" "EXIT" "Unspecified conversation ID"
chat "hialien"
name "Alien"
msg 0 "INIT" "EXIT" "Leave me alone"
chat "hi_icarus"
name "Icarus"
msg 2 "INIT" "hi" "Requesting permission to communicate..."

View file

@ -10,9 +10,6 @@ use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings};
use std::f32::consts::PI;
const ASTEROID_SIZE: f32 = 100.0;
const MARS_SIZE: f32 = 10.0;
const ASTRONAUT_SIZE: f32 = 5.0;
const PIZZERIA_SIZE: f32 = 30.0;
//const SKYBOX_BRIGHTNESS: f32 = 300.0;
//const SKYBOX_BRIGHTNESS_AR: f32 = 100.0;
@ -26,7 +23,7 @@ const ASSET_PIZZERIA: &str = "models/pizzeria.glb#Scene0";
const ASSET_JUPITER: &str = "models/jupiter.glb#Scene0";
fn asset_name_to_path(name: &str) -> &'static str {
match name {
"astronaut" => ASSET_ASTRONAUT,
"suit" => ASSET_ASTRONAUT,
"jupiter" => ASSET_JUPITER,
"asteroid1" => ASSET_ASTEROID1,
"asteroid2" => ASSET_ASTEROID2,
@ -175,51 +172,6 @@ pub fn setup(
));
}
// Add pizza alien
commands.spawn((
actor::Actor {
v: Vec3::new(-0.05, 0.2, 0.35),
angular_momentum: Quat::from_euler(EulerRot::XYZ, 0.0, 0.0001, 0.0),
..default()
},
actor::Talker { conv_id: "pizzeria".to_string(), pronoun: "it".to_string() },
SceneBundle {
transform: Transform {
translation: Vec3::new(
-2265.0,
10.0,
0.0,
),
rotation: Quat::from_rotation_y(-PI / 3.),
scale: Vec3::splat(ASTRONAUT_SIZE),
},
scene: asset_server.load(ASSET_ASTRONAUT),
..default()
},
));
// Add pizza place
commands.spawn((
actor::Actor {
v: Vec3::new(0.0, 0.0, 0.0),
angular_momentum: Quat::from_euler(EulerRot::XYZ, 0.0, 0.0001, 0.0),
..default()
},
SceneBundle {
transform: Transform {
translation: Vec3::new(
-2300.0,
10.0,
0.0,
),
rotation: Quat::from_rotation_y(-2.0 * -PI / 2.),
scale: Vec3::splat(PIZZERIA_SIZE),
},
scene: asset_server.load(ASSET_PIZZERIA),
..default()
},
));
// Add Light from the Sun
commands.spawn(DirectionalLightBundle {
directional_light: DirectionalLight {