Созданные ответы форума
-
АвторСообщения
-
sprite.setTextureRect(IntRect(0, 0, w, h));
обьясните, что значит эта строка?
Я ПРОСТО взял и скопировал код с урока, у меня всё так же как и в уроке…(кроме иницилизации dir и speed)
не пашет…
for (int i = 0; i < HEIGHT_MAP; i++)
for (int j = 0; j < WIDTH_MAP; j++)
{
if (TileMap[i][j] == ‘ ‘) s_map.setTextureRect(IntRect(0, 0, 32, 32));
if (TileMap[i][j] == ‘s’) s_map.setTextureRect(IntRect(32, 0, 32, 32));
if ((TileMap[i][j] == ‘0’)) s_map.setTextureRect(IntRect(64, 0, 32, 32));s_map.setPosition(j * 32, i * 32);
window.draw(p.sprite);
window.draw(s_map);}
window.display();
}return 0;
}зделал так – видно только карту…HELP…SOS…HELP
for (int i = 0; i < HEIGHT_MAP; i++)
for (int j = 0; j < WIDTH_MAP; j++)
{
if (TileMap[i][j] == ‘ ‘) s_map.setTextureRect(IntRect(0, 0, 32, 32));
if (TileMap[i][j] == ‘s’) s_map.setTextureRect(IntRect(32, 0, 32, 32));
if ((TileMap[i][j] == ‘0’)) s_map.setTextureRect(IntRect(64, 0, 32, 32));s_map.setPosition(j * 32, i * 32);
}
window.draw(p.sprite);
window.draw(s_map);
window.display();
}return 0;
}перенес всё так – не видит ни карты, ни персонажа…
{
if (TileMap[i][j] == ‘ ‘) s_map.setTextureRect(IntRect(0, 0, 32, 32));
if (TileMap[i][j] == ‘s’) s_map.setTextureRect(IntRect(32, 0, 32, 32));
if ((TileMap[i][j] == ‘0’)) s_map.setTextureRect(IntRect(64, 0, 32, 32));s_map.setPosition(j * 32, i * 32);
window.draw(p.sprite);
window.draw(s_map);}
писал так – не получается…
Извините, я просто еще с++ а именно в SFML не бум бум))
Тоисть? Как именно?
-
АвторСообщения