1use nightshade_api::prelude::*;
2
3fn main() {
4 let mut app = open();
5 show_grid(&mut app.world, false);
6 set_bloom(&mut app.world, true);
7 set_fog(
8 &mut app.world,
9 Some(Fog {
10 color: [0.7, 0.75, 0.85],
11 start: 30.0,
12 end: 120.0,
13 }),
14 );
15 spawn_floor(&mut app.world, 60.0);
16
17 for index in 0..14 {
18 let angle = index as f32 * 0.55;
19 let height = 3.0 + (index as f32 * 1.7).sin().abs() * 7.0;
20 let distance = 9.0 + index as f32;
21 let center = vec3(angle.cos() * distance, height * 0.5, angle.sin() * distance);
22 spawn_object(
23 &mut app.world,
24 Object {
25 position: center,
26 scale: vec3(2.0, height, 2.0),
27 color: rgb(0.35, 0.37, 0.42),
28 ..Object::default()
29 },
30 );
31 let window_glow = center + vec3(0.0, height * 0.5 + 0.5, 0.0);
32 point_light(&mut app.world, window_glow, [1.0, 0.7, 0.3], 4.0);
33 }
34
35 orbit_camera(&mut app.world, vec3(0.0, 4.0, 0.0), 35.0);
36 while frame(&mut app) {
37 let hour = (8.0 + elapsed_seconds(&app.world)) % 24.0;
38 set_time_of_day(&mut app.world, hour);
39 }
40}