Massive update, exposed a ton of functions
This commit is contained in:
@@ -6,4 +6,4 @@ edition = "2018"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
hypoloop = {version = "0.1.1", path = "D:/Code/hypoloop"}
|
||||
hypoloop = {version = "0.1.1", path = "D:/OneDrive/Code/hypoloop"}
|
||||
@@ -1,16 +1,20 @@
|
||||
use hypoloop::Simulation;
|
||||
use hypoloop::core::Loop;
|
||||
|
||||
// look into using closures for this
|
||||
fn main() {
|
||||
// create sim and configure it
|
||||
let mut sim = Simulation::new();
|
||||
sim.set_update_function(test);
|
||||
let mut sim = Loop::new();
|
||||
//sim.set_realtime(false);
|
||||
|
||||
// run sim
|
||||
sim.run();
|
||||
}
|
||||
// test variable
|
||||
let mut x: f32 = 0.0;
|
||||
|
||||
fn test() {
|
||||
println!("Test");
|
||||
// run the simulation using custom update logic
|
||||
sim.run(|state| {
|
||||
state.debug_tick();
|
||||
|
||||
x += 2.0 * state.get_timescale();
|
||||
|
||||
//println!("Delta time: {} | Timescale: {} | Sim time: {} | x: {}", state.get_delta_time(), state.get_timescale(), state.get_sim_time().as_millis(), x);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user