strange runtime error! my code checks to see if all images in the column have been clicked and when they are, the top image disappears but clicking on just the last image in the column causes the top image to disappear!
checking code
int CheckCategory(int category)
{
int check;
category = category - 1;
int end = category + 30;
for (; category < end;)
{
check = 0 + Jeopardy[category];
category = category + 6;
};
return check;
}
bool Clicked(int position, const sf::Input& Input)
{
int MouseX = Input.GetMouseX();
int MouseY = Input.GetMouseY();
bool MouseClicked = Input.IsMouseButtonDown(sf::Mouse::Left);
sf::Vector2f Position = Money[position].GetPosition();
if ((MouseX >= Position.x) && (MouseX <= (Position.x + 170))
&& (MouseY >= Position.y) && (MouseY <= (Position.y + 128))
&& (Jeopardy[position] == 1) && (MouseClicked == true))
return true;
else
return false;
}
if (Clicked(0, Window.GetInput()) == true)
Jeopardy[0] = 0;
if (Clicked(6, Window.GetInput()) == true)
Jeopardy[6] = 0;
if (Clicked(12, Window.GetInput()) == true)
Jeopardy[12] = 0;
if (Clicked(18, Window.GetInput()) == true)
Jeopardy[18] = 0;
if (Clicked(24, Window.GetInput()) == true)
Jeopardy[24] = 0;
if (CheckCategory(1) > 0)
Window.Draw(Categories[0]);
all of Jeopardy's values are set to 1 initially