Skip to content
Snippets Groups Projects
Commit acc43cf0 authored by Sindre Eiklid's avatar Sindre Eiklid
Browse files

Added random starting pos(and amount) for all instances

parent 2db9b15d
Branches
No related tags found
No related merge requests found
......@@ -55,9 +55,12 @@ Entity::Entity() {
//remember initial position to compute coalition when moving
aerialGridPosition.push_back({i, j});
aerialGridPossiblePath[i][j] = false;
//set random distance
if(j + 40 < g_mapData->gridWidth) j += randomIndex(5, 20);
}
}
}
std::cout << aerialInstanceIndex << std::endl;
//fill in random paths
std::vector<int> filler(aerialInstanceIndex, 0);
for(int i = 0; i < aerialInstanceIndex; i++) {
......@@ -97,6 +100,8 @@ Entity::Entity() {
//remember initial position to compute coalition when moving
groundGridPosition.push_back({i, j});
groundGridPossiblePath[i][j] = false;
//set random distance
if(j + 40 < g_mapData->gridWidth) j += randomIndex(5, 20);
}
}
}
......
......@@ -49,13 +49,13 @@ Vegetation::Vegetation() {
translation.y = g_mapData->gridElement[std::make_pair(i, j)][0][Z] * (100.f * 2.f);
instancePos[instanceIndex] = translation;
instanceIndex++;
if(j + 10 < g_mapData->gridWidth) j += randomIndex(2, 5);
//remember initial position to compute coalition when moving entities
g_mapData->obstaclesInGridElement[i][j] = false;
//set random distance
if(j + 10 < g_mapData->gridWidth) j += randomIndex(2, 5);
}
}
}
std::cout << instanceIndex << std::endl;
//send initial position to uniform
for(unsigned int i = 0; i < instanceIndex; i++) {
std::string buffer = "offsets[" + std::to_string(i) + "]";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment