|
|
|
|
|
|
|
|
#include <swan/Timer.h> |
|
|
#include <swan/Timer.h> |
|
|
|
|
|
|
|
|
#include <SFML/System/Clock.hpp> |
|
|
#include <SFML/System/Clock.hpp> |
|
|
|
|
|
#include <SFML/Audio.hpp> |
|
|
|
|
|
|
|
|
using namespace Swan; |
|
|
using namespace Swan; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abort(); |
|
|
abort(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Cretate window |
|
|
sf::RenderWindow window(sf::VideoMode(800, 600), "Project: SWAN"); |
|
|
sf::RenderWindow window(sf::VideoMode(800, 600), "Project: SWAN"); |
|
|
window.setVerticalSyncEnabled(true); |
|
|
window.setVerticalSyncEnabled(true); |
|
|
window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr()); |
|
|
window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr()); |
|
|
Win win(&window); |
|
|
Win win(&window); |
|
|
|
|
|
|
|
|
|
|
|
// Create music |
|
|
|
|
|
sf::SoundBuffer musicbuf; |
|
|
|
|
|
sf::Sound music; |
|
|
|
|
|
if (musicbuf.loadFromFile("assets/music/happy-1.wav")) { |
|
|
|
|
|
music.setBuffer(musicbuf); |
|
|
|
|
|
music.setLoop(true); |
|
|
|
|
|
music.play(); |
|
|
|
|
|
} else { |
|
|
|
|
|
fprintf(stderr, "Failed to load music! Am very sad.\n"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Game::initGlobal(); |
|
|
Game::initGlobal(); |
|
|
|
|
|
|
|
|
Game game(win); |
|
|
Game game(win); |