So I am trying to get an item to spawn on specific locations. I am using a xml parser to get the objects name and location (solid walls, start point, end point and item spawn points). It will only spawn on the last location and totally avoids the first. Anyway here is my code that I have so far:
the problem:
The spawn locations i want to place on:
The code:
for (int i = 0; i < obj.size(); i++)
{
if (obj[i].name == "item")
{
pickups->sprite.setPosition(obj[i].rect.left, obj[i].rect.top);
pickupVector.push_back(pickups);
}
}
so I want to spawn it on the first one location, then push it onto the array, then spawn the next one and put on array and so on..
↧