136
SFML projects / Danmagine
« on: May 14, 2010, 01:54:55 am »Quote
If you're using SFML2, can I ask on which OS you compile your programs?
I'm still on 1.6 sorry. I fear change.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
If you're using SFML2, can I ask on which OS you compile your programs?
for (int x = 0; x < 1024; x++)
{
for (int y = 0; y < 768; y++)
{
if (terrainImage.GetPixel(x, y) == sf::Color::White)//if pixel is white
{
terrainArray[x][y] = 0;//acts as nothing
}
else if (terrainImage.GetPixel(x, y) == sf::Color::Green)
{
terrainArray[x][y] = 1;//acts as normal land
}
else if (terrainImage.GetPixel(x, y) == sf::Color::Black)
{
terrainArray[x][y] = 2;//indestructible pixel
}
}
}