1
SFML projects / Re: 'Tiled' Tile-map Loader
« on: October 27, 2015, 01:02:50 am »
Hi guys,
I have everything working for my game project, but for some reason; whenever I place a collision box in the TILED editor; my program only picks up one collision box and does not recognize the rest.
Here is my current code:
Is there something I'm missing?
Thank you in advance for your time.
I have everything working for my game project, but for some reason; whenever I place a collision box in the TILED editor; my program only picks up one collision box and does not recognize the rest.
Here is my current code:
Quote
for (auto layer = ml.GetLayers().begin(); layer != ml.GetLayers().end(); ++layer)
{
if (layer->name == "Collision")
{
for (auto object = layer->objects.begin(); object != layer->objects.end(); ++object)
{
collision = object->Contains(sf::Vector2f(actorPlayer.getPosition()));
}
}
}
Is there something I'm missing?
Thank you in advance for your time.