diff --git a/src/tunnels_player.cpp b/src/tunnels_player.cpp index a053525..abfb306 100644 --- a/src/tunnels_player.cpp +++ b/src/tunnels_player.cpp @@ -54,18 +54,13 @@ void TunnelsPlayer::_process(double delta_time) { GDGAMEONLY(); case State::ManualControl: // send the current wasd input to the character this->character->move(this->get_world_move_input().normalized()); + // fall through to shared functionality + case State::Tactics: // send the current world cursor position the character this->character->aim(mouse_world_location); // move the camera along with the character this->set_global_position(this->character->get_global_position()); break; - case State::Tactics: - // move camera along with the input - this->set_global_position(this->get_global_position() + this->get_world_move_input().normalized() * - delta_time * TunnelsPlayer::TACTICS_MOVEMENT_SPEED); - break; - case State::Overview: - break; } } @@ -142,8 +137,6 @@ void TunnelsPlayer::fire_pressed(Ref event, float value) { if(value == 1.f) this->try_select_marker(); break; - case State::Overview: - break; } } @@ -166,6 +159,7 @@ void TunnelsPlayer::try_select_marker() { if(marker == nullptr) return; UtilityFunctions::print("Hit: ", marker->get_path()); + // select a character to send orders to CharacterActor *target_character{nullptr}; for(CharacterActor *loop_character : Ref(GameRoot::get_singleton()->get_game_mode())->get_player_characters()) { if(loop_character != this->character) { @@ -256,5 +250,4 @@ float const TunnelsPlayer::ROTATION_SPEED{0.5f}; float const TunnelsPlayer::ROTATION_Y_MIN_INFLUENCE{7.f}; float const TunnelsPlayer::ROTATION_MARGIN{0.4f}; float const TunnelsPlayer::ROTATION_MARGIN_TACTICS_MUL{0.6f}; -float const TunnelsPlayer::TACTICS_MOVEMENT_SPEED{10.f}; }