mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-13 14:53:41 +00:00
add documentation to calculateSpawnPosition
This commit is contained in:
parent
7e088594ae
commit
29743d11b0
@ -27,6 +27,12 @@ public:
|
|||||||
void createProjectile(Vector2D pos, Vector2D velocity, int scale, int range, int speed, const char* texturePath, Entity* owner);
|
void createProjectile(Vector2D pos, Vector2D velocity, int scale, int range, int speed, const char* texturePath, Entity* owner);
|
||||||
void createPowerup(Vector2D pos, std::function<void (Entity*)> pickupFunc, std::string texturePath);
|
void createPowerup(Vector2D pos, std::function<void (Entity*)> 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);
|
Vector2D calculateSpawnPosition(Vector2D size, Vector2D spawnArea);
|
||||||
template <typename T> [[deprecated]] T calculateRandomType(int amount);
|
template <typename T> [[deprecated]] T calculateRandomType(int amount);
|
||||||
|
|
||||||
|
|||||||
@ -74,6 +74,7 @@ void AssetManager::createPowerup(Vector2D pos, std::function<void (Entity*)> pic
|
|||||||
powerups.addGroup((size_t)Entity::GroupLabel::POWERUPS);
|
powerups.addGroup((size_t)Entity::GroupLabel::POWERUPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Vector2D AssetManager::calculateSpawnPosition(Vector2D size, Vector2D spawnArea)
|
Vector2D AssetManager::calculateSpawnPosition(Vector2D size, Vector2D spawnArea)
|
||||||
{
|
{
|
||||||
Vector2D spawnPos = Vector2D(-1, -1);
|
Vector2D spawnPos = Vector2D(-1, -1);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user