我是SFML的新手,正在开发游戏“Memory Match”4x4。为了简化我正在加载2个不同的图像。每次我得到阵列上的最后一个图像。任何人都可以说我做错了吗?
string s[] = {
"C:/Users/Eldar/Desktop/sfml/image.png",
"C:/Users/Eldar/Desktop/sfml/redDie.png"
};
int k = 0;
for (int i = 0; i <= 3; i++){
for (int j = 0; j <= 3; j++){
cout << k << endl;
Cards[i][j].setScale(1, 1);
Cards[i][j].setPosition(0 + ioffset, 0 + joffset);
textureCard.loadFromFile(s[k]);
Cards[i][j].setTexture(textureCard);
k++;
if (k == 2) k = 0;
}
}