add initial ghost logic

This commit is contained in:
2025-11-15 20:56:25 -05:00
parent 20eb36945b
commit e7d999109d
6 changed files with 104 additions and 5 deletions
+10
View File
@@ -1,5 +1,7 @@
#include "MazeMap.h"
#include "Entity.h"
#include <SFML/System/Vector2.hpp>
#include <cmath>
bool MazeMap::loadMaze(const std::vector<int>& collisionData,
const std::vector<int>& pelletData,
@@ -265,3 +267,11 @@ void MazeMap::handleTunnelWrapping(Entity& entity) {
entity.setPosition({newX, pos.y});
}
};
float MazeMap::distanceBetweenTiles(sf::Vector2i t1, sf::Vector2i t2) {
sf::Vector2i delta = {t1.x - t2.x, t1.y - t2.y};
float distance = std::sqrt(delta.x * delta.x + delta.y * delta.y);
return distance;
};