Skip to content

Commit

Permalink
more fixes, still doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
vorlac committed Oct 6, 2023
1 parent 1fb4f65 commit b3ffbcc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion project/scenes/characters/enemy.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[ext_resource type="Texture2D" uid="uid://cjlu0wl3qj8dh" path="res://assets/art/topdown/shooter/robot_1/robot1_gun.png" id="1_oue85"]

[node name="Enemy" type="Character"]
[node name="Enemy" type="Enemy"]
scale = Vector2(2, 2)
collision_mask = 8
platform_on_leave = 2
Expand Down
21 changes: 8 additions & 13 deletions src/nodes/character/character.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
#include "nodes/camera.hpp"
#include "util/attributes.hpp"
#include "util/bind.hpp"
#include "util/concepts.hpp"
#include "util/constants.hpp"

#include <concepts>

#include <godot_cpp/classes/character_body2d.hpp>
#include <godot_cpp/classes/collision_shape2d.hpp>
#include <godot_cpp/classes/object.hpp>
#include <godot_cpp/classes/sprite2d.hpp>
#include <godot_cpp/variant/variant.hpp>
#include <godot_cpp/variant/vector2.hpp>

namespace godot
{
class Marker2D;
class Object;
class Vector2;
}

namespace rl
{
class CharacterController;
}

namespace rl
{
class Character : public godot::CharacterBody2D
{
GDCLASS(Character, godot::CharacterBody2D);
Expand Down Expand Up @@ -66,17 +67,11 @@ namespace rl
using add_pos_changed_signal_binding_t
= pos_changed_signal_t::template add<godot::Object*, godot::Vector2>;
add_pos_changed_signal_binding_t();

using spawn_projectile_signal_t
= std::type_identity_t<signal_binding<T, event::position_changed>>;
using add_spawn_projectile_signal_binding_t
= spawn_projectile_signal_t::template add<godot::Object*, godot::Vector2>;
add_spawn_projectile_signal_binding_t();
}

static void _bind_methods()
{
Character::bind_member_functions<Character>();
bind_member_functions<Character>();
}

protected:
Expand Down
10 changes: 5 additions & 5 deletions src/nodes/character/character_controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ namespace rl
= character_shoot_signal_t::template add<godot::Object*>;
add_character_shoot_signal_binding_t();

// using position_changed_signal_t
// = std::type_identity_t<signal_binding<T, event::position_changed>>;
// using add_position_changed_signal_binding_t
// = position_changed_signal_t::template add<godot::Object*, godot::Vector2>;
// add_position_changed_signal_binding_t();
using position_changed_signal_t
= std::type_identity_t<signal_binding<T, event::position_changed>>;
using add_position_changed_signal_binding_t
= position_changed_signal_t::template add<godot::Object*, godot::Vector2>;
add_position_changed_signal_binding_t();
}

static void _bind_methods();
Expand Down

0 comments on commit b3ffbcc

Please sign in to comment.