feat: added interactions, demo packs and destructables

This commit is contained in:
Sara 2025-07-28 21:17:11 +02:00
parent d66c999039
commit 5a4ac26c72
12 changed files with 369 additions and 23 deletions

View file

@ -9,6 +9,7 @@ String PlayerInput::sig_switch_weapon{ "switch_weapon" };
String PlayerInput::sig_run{ "run" };
String PlayerInput::sig_jump{ "jump" };
String PlayerInput::sig_crouch{ "crouch" };
String PlayerInput::sig_activate{ "activate" };
void PlayerInput::_bind_methods() {
ADD_SIGNAL(MethodInfo(sig_movement_input, PropertyInfo(Variant::VECTOR2, "axes")));
@ -19,6 +20,7 @@ void PlayerInput::_bind_methods() {
ADD_SIGNAL(MethodInfo(sig_run, PropertyInfo(Variant::BOOL, "is_running")));
ADD_SIGNAL(MethodInfo(sig_jump));
ADD_SIGNAL(MethodInfo(sig_crouch, PropertyInfo(Variant::BOOL, "is_crouching")));
ADD_SIGNAL(MethodInfo(sig_activate));
}
void PlayerInput::normalize_input() {
@ -83,4 +85,7 @@ void PlayerInput::unhandled_input(Ref<InputEvent> const &event) {
if (event->is_action("switch_weapon") && event->is_pressed()) {
emit_signal(sig_switch_weapon);
}
if (event->is_action("activate") && event->is_pressed()) {
emit_signal(sig_activate);
}
}