mapcreator git · master
SDL3 2.5D game and engine using assets, with map editor
C++ 99.3%git clone https://git.christianimmanuel.de/sdl-graphics/mapcreator.gitwget https://git.christianimmanuel.de/sdl-graphics/mapcreator/archive/mapcreator.tar.gz..
src/character/enemy.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/character/enemy.cpp b/src/character/enemy.cpp index c420dc5..34b9918 100644 --- a/src/character/enemy.cpp +++ b/src/character/enemy.cpp @@ -756,8 +756,9 @@ void Enemy::move_Path() { dx /= len; dy /= len; bool left = (std::rand() % 2) == 0; - float px = left ? -dy : dy; + float px = left ? -dy : dy; float py = left ? dx : -dx; + float distance = 40.0f + static_cast<float>(std::rand()) / (static_cast<float>(RAND_MAX) / 40.0f); SDL_FPoint result = { @@ -995,13 +996,11 @@ Enemy::Update(Character& player) { moving_logic.duration <= 0)) { Decide(player); handle_Animation(); - std::cout << "MVT1 " << id << " " << (int)moving_logic.move_type << std::endl; return; } else if (moving_logic.move_type == EnemyMovingType::IDLE) { moving_logic.duration -= Default::delta_time; handle_Animation(); - std::cout << "IDLE? " << id << std::endl; return; } else if (moving_logic.move_type == EnemyMovingType::WALK) { @@ -1010,7 +1009,6 @@ Enemy::Update(Character& player) { moving_logic.moving_distance.y >= moving_logic.max_distance ) { moving_logic.move_type = EnemyMovingType::NONE; handle_Animation(); - std::cout << "BLOCKED? " << id << std::endl; return; } }