diff --git a/include/AssetManager.h b/include/AssetManager.h index 14d7bad..6cb3719 100644 --- a/include/AssetManager.h +++ b/include/AssetManager.h @@ -27,6 +27,12 @@ public: void createProjectile(Vector2D pos, Vector2D velocity, int scale, int range, int speed, const char* texturePath, Entity* owner); void createPowerup(Vector2D pos, std::function pickupFunc, std::string texturePath); + /*! + * \brief Calculates a random spawn position for an object within a given area + * \param size The size (collision box) of the object + * \param spawnArea The area within which a spawn position will be calculated + * \returns Spawn Coordinates for the object + */ Vector2D calculateSpawnPosition(Vector2D size, Vector2D spawnArea); template [[deprecated]] T calculateRandomType(int amount); diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 252fab5..3841cf3 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -74,6 +74,7 @@ void AssetManager::createPowerup(Vector2D pos, std::function pic powerups.addGroup((size_t)Entity::GroupLabel::POWERUPS); } + Vector2D AssetManager::calculateSpawnPosition(Vector2D size, Vector2D spawnArea) { Vector2D spawnPos = Vector2D(-1, -1);