Hi! If have a really weird problem
The y output is not a number but is :
Jeleki
eleki
leki
eki
ki
i
:AM:am:PM:pm
AM:am:PM:pm
Jeleki is the title of the window.
void display_game(sf::RenderWindow& window, float interpolation)
{
window.clear();
for (int x = 0; x < 50; x++) {
for (int y = 0; y < 50; y++) {
//Check if tile should be drawn
if (mapdata[x][y] == 1) {
sf::Texture tile;
if (!tile.loadFromFile("floor_tile_1.png"))
{
std::cout << "Error could not load floor tile!";
}
sf::Sprite tilesprite;
tilesprite.setTexture(tile);
//int px = x * 40 + 1;
//int py = y * 20 + 1;
int px = (x - y) * 20;
int py = (y - x) * 10;
tilesprite.setPosition(px + 500, py + 300);
window.draw(tilesprite);
//std::cout << "x:" + x << std::endl;
std::cout << "y:" + y << std::endl;
}
}
}
window.display();
}
If anyone has a clue what is causing this please let me know.