Added Map Rendering
This commit is contained in:
parent
37a249dc62
commit
ea72294a3e
8 changed files with 114 additions and 97 deletions
10
src/Game.cpp
10
src/Game.cpp
|
@ -2,8 +2,6 @@
|
|||
|
||||
Game::Game(sf::RenderWindow& window) : window(window)
|
||||
{
|
||||
enemies.emplace_back(sf::Vector2f{100, 100});
|
||||
enemies.emplace_back(sf::Vector2f{200, 200});
|
||||
}
|
||||
|
||||
#include <iostream>
|
||||
|
@ -22,12 +20,16 @@ void Game::run()
|
|||
std::cout << "Loading took: " << milliseconds << std::endl;
|
||||
#endif
|
||||
|
||||
map.setPosition(sf::Vector2f{20, 20});
|
||||
|
||||
if (err.code != 0)
|
||||
{
|
||||
std::cout << err.message << std::endl;
|
||||
return;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
map.debug();
|
||||
#endif
|
||||
while (window.isOpen())
|
||||
{
|
||||
while (const auto event = window.pollEvent())
|
||||
|
@ -42,10 +44,6 @@ void Game::run()
|
|||
// Render game
|
||||
window.clear({0x20, 0x20, 0x20,0xff});
|
||||
|
||||
for (auto& enemy : enemies)
|
||||
{
|
||||
window.draw(enemy);
|
||||
}
|
||||
window.draw(map);
|
||||
|
||||
window.display();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue