diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-04-15 22:22:45 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-04-15 22:22:45 -0400 |
| commit | 3dc92fad981e28c760f3c6e95f5a8153ea6c9be4 (patch) | |
| tree | 9e806c4ad09cf22957bc4dccd415718045fc4b0f /src/main.rs | |
| parent | b5ced3af46c96ceb959fbbf1addfeba3bd4f76d5 (diff) | |
| download | systemic4x-3dc92fad981e28c760f3c6e95f5a8153ea6c9be4.tar.gz systemic4x-3dc92fad981e28c760f3c6e95f5a8153ea6c9be4.tar.bz2 systemic4x-3dc92fad981e28c760f3c6e95f5a8153ea6c9be4.zip | |
work on orbits (not right yet), orbit camera
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index b6efdcd..ae4233e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,7 @@ use std::cell::RefCell; use std::thread; use std::time::{Duration, Instant}; +use serde::de; use winit::event::{KeyEvent, WindowEvent}; use winit::event_loop::{EventLoop, ActiveEventLoop, ControlFlow}; use winit::error::{EventLoopError}; @@ -82,6 +83,16 @@ impl GameState pub fn timeman_mut(&mut self) -> &mut TimeMan { &mut self.timeman } + + fn update( + &mut self, + dt: Duration) + { + self.timeman.update(); + self.solar_systems.iter_mut().for_each(|solar_system| { + solar_system.update(self.timeman.seconds()); + }); + } } impl ApplicationHandler for SystemicApp @@ -126,7 +137,7 @@ impl ApplicationHandler for SystemicApp let delta_time = now - self.last_render_time; self.last_render_time = now; - game_state.borrow_mut().timeman.update(); + game_state.borrow_mut().update(delta_time); { window.update(game_state, delta_time); } |
