MCPcopy Create free account
hub / github.com/Schr3da/gdext-rust-tutorials / new_game

Method new_game

signals/rust/src/entry_node.rs:45–61  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

43 }
44
45 pub fn new_game(&mut self) {
46 let instance = match self.game_scene.instantiate() {
47 Some(instance) => instance,
48 None => {
49 godot_error!("Unable to load scene");
50 return;
51 }
52 };
53
54 let mut base = self.base_mut();
55
56 base.get_children().iter_shared().for_each(|c| {
57 base.remove_child(&c);
58 });
59
60 base.add_child(&instance);
61 }
62}

Callers 1

new_game_pressedMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected