diff options
author | cel <cel@blos.sm> | 2022-07-16 22:42:19 +0100 |
---|---|---|
committer | cel <cel@blos.sm> | 2022-07-16 22:42:19 +0100 |
commit | fdbba87b346c6020d7349d0c2cb3793fcdab25f3 (patch) | |
tree | 7c5f3481dc1bd77d332a318d687eb714fea3ef68 /rust/src/game.rs | |
parent | 717a665a84dd9ca1b545d57976b87ba77bf11d80 (diff) | |
download | 2022-fdbba87b346c6020d7349d0c2cb3793fcdab25f3.tar.gz 2022-fdbba87b346c6020d7349d0c2cb3793fcdab25f3.tar.bz2 2022-fdbba87b346c6020d7349d0c2cb3793fcdab25f3.zip |
add menu and switch die code from rust to gdscript
Diffstat (limited to '')
-rw-r--r-- | rust/src/game.rs | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/rust/src/game.rs b/rust/src/game.rs deleted file mode 100644 index 61b23ed..0000000 --- a/rust/src/game.rs +++ /dev/null @@ -1,44 +0,0 @@ -use gdnative::api::*; -use gdnative::prelude::*; - -/// The Game "class" -#[derive(NativeClass)] -#[inherit(Spatial)] -#[register_with(Self::register_builder)] -pub struct Game { - name: String, -} - -// __One__ `impl` block can have the `#[methods]` attribute, which will generate -// code to automatically bind any exported methods to Godot. -#[methods] -impl Game { - // Register the builder for methods, properties and/or signals. - fn register_builder(_builder: &ClassBuilder<Self>) { - godot_print!("Game builder is registered!"); - } - - /// The "constructor" of the class. - fn new(_owner: &Spatial) -> Self { - godot_print!("Game is created!"); - Game { - name: "".to_string(), - } - } - - // In order to make a method known to Godot, the #[export] attribute has to be used. - // In Godot script-classes do not actually inherit the parent class. - // Instead they are "attached" to the parent object, called the "owner". - // The owner is passed to every single exposed method. - #[export] - unsafe fn _ready(&mut self, _owner: &Spatial) { - // The `godot_print!` macro works like `println!` but prints to the Godot-editor - // output tab as well. - self.name = "Game".to_string(); - godot_print!("{} is ready!", self.name); - } - - // This function will be called in every frame - #[export] - unsafe fn _process(&self, _owner: &Spatial, _delta: f64) { } -} |