Upload files to "/"
This commit is contained in:
parent
3473670f67
commit
c898dd8996
4 changed files with 147 additions and 0 deletions
31
game.cpp
Normal file
31
game.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include <SFML/Graphics.hpp>
|
||||
#include "vokzal.hpp"
|
||||
|
||||
int main() {
|
||||
// Створюємо вікно 800x600
|
||||
sf::RenderWindow window(sf::VideoMode(1950, 1200), "Test Game Window");
|
||||
|
||||
|
||||
window.setFramerateLimit(90); //вище 200 не рокимендую піднімати частоту після 600 буде чути писк дроселів
|
||||
|
||||
Player player;
|
||||
// Простий квадрат для гравця
|
||||
|
||||
sf::Clock clock;
|
||||
while (window.isOpen()) {
|
||||
sf::Event event;
|
||||
while (window.pollEvent(event)) {
|
||||
if (event.type == sf::Event::Closed)
|
||||
window.close();}
|
||||
|
||||
//if(event.type== sf::Event::Resized){}
|
||||
float deltaTime = clock.restart().asSeconds();
|
||||
|
||||
player.update(deltaTime); // викликаємо логіку гравця
|
||||
window.clear(sf::Color::Black); // очистка вікна
|
||||
player.draw(window); // малюємо квадрат
|
||||
window.display(); // відображення
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue