sorry for double posting but the SVN just broke my code
#ifdef _DEBUG
#pragma comment(lib, "sfml-main-d.lib")
#pragma comment(lib, "sfml-system-s-d.lib")
#pragma comment(lib, "sfml-window-s-d.lib")
#pragma comment(lib, "sfml-graphics-s-d.lib")
#pragma comment(lib, "sfml-audio-s-d.lib")
#pragma comment(lib, "sfml-network-s-d.lib")
#endif
#ifdef NDEBUG
#pragma comment(lib, "sfml-main.lib")
#pragma comment(lib, "sfml-window-s.lib")
#pragma comment(lib, "sfml-system-s.lib")
#pragma comment(lib, "sfml-graphics-s.lib")
#pragma comment(lib, "sfml-audio-s.lib")
#pragma comment(lib, "sfml-network-s.lib")
#endif
#include "string"
#include "SFML/System.hpp"
#include "SFML/Window.hpp"
#include "SFML/Audio.hpp"
#include "SFML/Network.hpp"
#include "SFML/Graphics.hpp"
#include "SFML/Quickstart.h"
int Question = 0;
int JeopardyPos = 0;
int Jeopardy[25];
sf::Sprite Questions[25];
sf::Sprite HorizontalBars[5];
sf::Sprite VerticalBars[5];
sf::Sprite Categories[5];
sf::Image n100;
sf::Image n200;
sf::Image n300;
sf::Image n400;
sf::Image n500;
sf::Image Who;
sf::Image Dates;
sf::Image Where;
sf::Image Numbers;
sf::Image Random;
sf::Image HorizontalBar;
sf::Image VerticalBar;
int LoadImages()
{
if (!Who.LoadFromFile("G:/Jeopardy/Jeopardy Who.bmp"))
return EXIT_FAILURE;
if (!Dates.LoadFromFile("G:/Jeopardy/Jeopardy Dates.bmp"))
return EXIT_FAILURE;
if (!Where.LoadFromFile("G:/Jeopardy/Jeopardy Locations.bmp"))
return EXIT_FAILURE;
if (!Numbers.LoadFromFile("G:/Jeopardy/Jeopardy Numbers.bmp"))
return EXIT_FAILURE;
if (!Random.LoadFromFile("G:/Jeopardy/Jeopardy Random.bmp"))
return EXIT_FAILURE;
if (!n100.LoadFromFile("G:/Jeopardy/$100.bmp"))
return EXIT_FAILURE;
if (!n200.LoadFromFile("G:/Jeopardy/$200.bmp"))
return EXIT_FAILURE;
if (!n300.LoadFromFile("G:/Jeopardy/$300.bmp"))
return EXIT_FAILURE;
if (!n400.LoadFromFile("G:/Jeopardy/$400.bmp"))
return EXIT_FAILURE;
if (!n500.LoadFromFile("G:/Jeopardy/$500.bmp"))
return EXIT_FAILURE;
if (!VerticalBar.LoadFromFile("G:/Jeopardy/Jeopardy Vertical Bar.bmp"))
return EXIT_FAILURE;
if (!HorizontalBar.LoadFromFile("G:/Jeopardy/Jeopardy Horizontal Bar.bmp"))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
sf::Music Music;
int LoadMusic()
{
if (!Music.OpenFromFile("G:/Jeopardy/Jeopardy.wav"))
{
return EXIT_FAILURE;
};
return EXIT_SUCCESS;
}
void JeopardyArray()
{
for (int pos = 0; pos < 25; pos++)
{
Jeopardy[pos] = 1;
}
}
void QuestionsArray()
{
for (int sprite = 0; sprite < 25; sprite++)
{
if (sprite < 5)
Questions[sprite] = sf::Sprite(n100);
if (sprite < 10 && sprite > 4)
Questions[sprite] = sf::Sprite(n200);
if (sprite < 15 && sprite > 9)
Questions[sprite] = sf::Sprite(n300);
if (sprite < 20 && sprite > 14)
Questions[sprite] = sf::Sprite(n400);
if (sprite < 25 && sprite > 19)
Questions[sprite] = sf::Sprite(n500);
}
}
void BarArray()
{
for (int sprite = 0; sprite < 5; sprite++)
{
VerticalBars[sprite] = sf::Sprite(VerticalBar);
HorizontalBars[sprite] = sf::Sprite(HorizontalBar);
};
}
void SetPositions()
{
int x = 0;
int y = 148;
for (int repeat = 0; repeat < 25; repeat++)
{
Questions[repeat].SetPosition(x,y);
x = x+204;
if (x == 1020)
{
y = y+124;
x = 0;
};
};
}
int Load()
{
LoadImages();
LoadMusic();
Music.Play();
JeopardyArray();
QuestionsArray();
BarArray();
SetPositions();
return EXIT_SUCCESS;
}
#include "Headers.h"
int main()
{
sf::RenderWindow Window(sf::VideoMode(1024, 768, 32), "Jeopardy!", sf::Style::Fullscreen);
sf::Color Background(222, 41, 16);
Window.SetBackgroundColor(Background);
Load();
sf::Sprite C1(Who);
sf::Sprite C2(Dates);
sf::Sprite C3(Where);
sf::Sprite C4(Numbers);
sf::Sprite C5(Random);
C2.SetPosition(204,0);
C3.SetPosition(408,0);
C4.SetPosition(612,0);
C5.SetPosition(816,0);
bool Running = true;
while(Running)
{
sf::Event Event;
const sf::Input& Input = Window.GetInput();
int MouseX = Input.GetMouseX();
int MouseY = Input.GetMouseY();
while (Window.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
Running = false;
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
Running = false;
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::F))
Music.Play();
if ((0 < MouseX && MouseX < 162 && 124 < MouseY && MouseY < 260) && (Event.MouseButton.Button == sf::Mouse::Left) && (Jeopardy[1] == 1))
{
Question = 1;
JeopardyPos = 1;
};
if ((Event.MouseButton.Button == sf::Mouse::Right) && (Question > 0))
{
Jeopardy[JeopardyPos] = 0;
Question = 0;
};
};
for (int x = 0; x < 25; x++)
{
Window.Draw(Questions[x]);
};
Window.Display();
}
return 0;
}