heres my code, i cant seem to find why it wont work plz check for errors due to misused/wrong syntax
#include "SFML/Quickstart.h"
#include "SFML/String Conversion.h"
int width;
int height;
int IW;
int IH;
int begin;
int finish;
std::string base = "C:/Jeopardy/";
std::string end = ".png";
sf::Sprite Categories[6];
sf::Sprite Money[5];
sf::Sprite Opening;
sf::Sprite Questions[30];
sf::Sprite Answers[30];
sf::Image categories[6];
sf::Image money[5];
sf::Image questions[30];
sf::Image answers[30];
sf::Image opening;
sf::Music OpeningMusic;
sf::Music FinalJeopardyMusic;
void GetDesktopMode()
{
sf::VideoMode DesktopMode = sf::VideoMode::GetDesktopMode();
width = DesktopMode.Width;
height = DesktopMode.Height;
}
int LoadImages()
{
for(begin = 0, finish = 5; begin < finish; begin++)
{
std::string middle = Convert(begin);
std::string image = base + "Categories/Slide" + middle + end;
if (!categories[begin].LoadFromFile(image))
return EXIT_FAILURE;
};
for(begin = 0, finish = 4; begin < finish; begin++)
{
std::string middle = Convert(begin);
std::string image = base + "Categories/Money" + middle + end;
if (!money[begin].LoadFromFile(image))
return EXIT_FAILURE;
};
for(begin = 0, finish = 29; begin < finish; begin++)
{
std::string middle = Convert(begin);
std::string image = base + "Categories/Questions" + middle + end;
if (!questions[begin].LoadFromFile(image))
return EXIT_FAILURE;
};
for(begin = 0, finish = 29; begin < finish; begin++)
{
std::string middle = Convert(begin);
std::string image = base + "Categories/Answers" + middle + end;
if (!answers[begin].LoadFromFile(image))
return EXIT_FAILURE;
};
if (!opening.LoadFromFile("C:/Jeopardy/Other/Opening.png"))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
void LoadSprites()
{
for (begin = 0, finish = 5; begin < finish; begin++)
Categories[begin] = sf::Sprite(categories[begin]);
for (begin = 0, finish = 4; begin < finish; begin++)
Money[begin] = sf::Sprite(money[begin]);
Opening.SetImage(opening);
for (begin = 0, finish = 29; begin < finish; begin++)
Questions[begin] = sf::Sprite(questions[begin]);
for (begin = 0, finish = 29; begin < finish; begin++)
Answers[begin] = sf::Sprite(answers[begin]);
}
void ScaleSprites()
{
for (begin = 0, finish = 5; begin < finish; begin++)
{
IW = categories[begin].GetWidth();
IH = categories[begin].GetHeight();
IW = ((width/6) * IW);
IH = ((height/6) * IH);
Categories[begin].Scale(IW, IH);
};
for (begin = 0, finish = 4; begin < finish; begin++)
{
IW = money[begin].GetWidth();
IH = money[begin].GetHeight();
IW = ((width/6) * IW);
IH = ((height/6) * IH);
Money[begin].Scale(IW, IH);
};
for (begin = 0, finish = 29; begin < finish; begin++)
{
IW = questions[begin].GetWidth();
IH = questions[begin].GetHeight();
IW = ((width/6) * IW);
IH = ((height/6) * IH);
Questions[begin].Scale(IW, IH);
};
for (begin = 0, finish = 29; begin < finish; begin++)
{
IW = answers[begin].GetWidth();
IH = answers[begin].GetHeight();
IW = ((width/6) * IW);
IH = ((height/6) * IH);
Answers[begin].Scale(IW, IH);
};
}
int LoadMusic()
{
if (!OpeningMusic.OpenFromFile("C:/Jeopardy/Music/Opening.wav"))
return EXIT_FAILURE;
if (!FinalJeopardyMusic.OpenFromFile("C:/Jeopardy/Music/Final Jeopardy.wav"))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
int Load()
{
GetDesktopMode();
LoadImages();
LoadSprites();
LoadMusic();
ScaleSprites();
OpeningMusic.Play();
return EXIT_SUCCESS;
}
#include "Jeopardy.h"
int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Jeopardy!");
Load();
while(App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
App.Close();
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
};
App.Clear();
App.Draw(Opening);
App.Display();
};
return EXIT_SUCCESS;
}