diff options
Diffstat (limited to '')
-rw-r--r-- | rust/src/goal_trigger.rs | 30 | ||||
-rw-r--r-- | rust/src/lib.rs | 2 |
2 files changed, 32 insertions, 0 deletions
diff --git a/rust/src/goal_trigger.rs b/rust/src/goal_trigger.rs new file mode 100644 index 0000000..457eb7b --- /dev/null +++ b/rust/src/goal_trigger.rs @@ -0,0 +1,30 @@ +use gdnative::api::*; +use gdnative::prelude::*; +use gdnative::core_types::VariantArray; +use gdnative::object::*; + +/// The SpinningCube "class" +#[derive(NativeClass)] +#[inherit(Node)] +pub struct GoalTriggerZone { + level_loader: Option<Ref<Node>>, +} + +#[methods] +impl GoalTriggerZone { + fn new(_owner: &Node) -> Self { + GoalTriggerZone { + level_loader: None, + } + } + + #[export] + unsafe fn _ready(&mut self, owner: &Node) { + // TODO get loader + } + + #[export] + fn overlap(&mut self, owner: &Node) { + godot_print!("OVERLAPPED"); + } +} diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 30f4f2a..1be319a 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -5,6 +5,7 @@ mod buff_phase; mod buff_trait; mod buff_ball; mod buff_extra; +pub mod goal_trigger; mod test; mod basic_die; @@ -14,6 +15,7 @@ use gdnative::prelude::{godot_init, InitHandle}; fn init(handle: InitHandle) { handle.add_class::<game::Game>(); handle.add_class::<spinning_cube::SpinningCube>(); + handle.add_class::<goal_trigger::GoalTriggerZone>(); handle.add_class::<test::SpinningCubeReverse>(); handle.add_class::<basic_die::BasicDie>(); } |