MCPcopy Create free account
hub / github.com/17cupsofcoffee/nova / new

Method new

examples/bunnymark.rs:29–37  ·  view source on GitHub ↗
(rng: &mut ThreadRng)

Source from the content-addressed store, hash-verified

27
28impl Bunny {
29 fn new(rng: &mut ThreadRng) -> Bunny {
30 let x_vel = rng.gen::<f32>() * 5.0;
31 let y_vel = (rng.gen::<f32>() * 5.0) - 2.5;
32
33 Bunny {
34 position: Vec2::new(0.0, 0.0),
35 velocity: Vec2::new(x_vel, y_vel),
36 }
37 }
38}
39
40struct GameState {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected