29 lines
486 B
C++
29 lines
486 B
C++
#include <SFML/Graphics.hpp>
|
|
|
|
int main()
|
|
{
|
|
sf::RenderWindow window(sf::VideoMode(1024, 800), "Space Invader", sf::Style::Titlebar | sf::Style::Close);
|
|
|
|
while (window.isOpen())
|
|
{
|
|
sf::Event event;
|
|
while (window.pollEvent(event))
|
|
{
|
|
if (event.type == sf::Event::Closed)
|
|
{
|
|
window.close();
|
|
}
|
|
else if (event.type == sf::Event::KeyPressed)
|
|
{
|
|
if (event.key.code == sf::Keyboard::Escape)
|
|
{
|
|
window.close();
|
|
}
|
|
}
|
|
}
|
|
|
|
// Update here
|
|
}
|
|
|
|
return 0;
|
|
} |