add set player

This commit is contained in:
Bluub
2021-06-18 18:36:02 +02:00
parent 638be2f3a8
commit 278cb9204f
3 changed files with 21 additions and 2 deletions
+8 -1
View File
@@ -11,7 +11,8 @@
namespace BBM
{
LuaMap::LuaMap()
: _map(17, std::vector<int>(17, 0)), _danger(17, std::vector<int>(17, 0))
: _map(17, std::vector<int>(17, 0)), _danger(17, std::vector<int>(17, 0)),
_player(), _roundedPlayer()
{
}
@@ -39,6 +40,12 @@ namespace BBM
return true;
}
void LuaMap::setPlayer(Vector3f pos)
{
_player = Vector2f(pos.x, pos.y);
_roundedPlayer = Vector2f(std::round(_player.x), std::round(_player.y));
}
std::vector<Vector2f> LuaMap::fillPath(std::vector<Vector2f> &path,
std::unordered_map<Vector2f, Vector2f> &cameFrom, Vector2f node) const
{