2019-05-27 13:50:49 +02:00
|
|
|
#include <iostream>
|
2024-01-21 22:03:04 +00:00
|
|
|
#include <SFML/Graphics.hpp>
|
2019-05-27 13:50:49 +02:00
|
|
|
|
|
|
|
#include "World.h"
|
|
|
|
|
2023-12-30 14:50:35 +01:00
|
|
|
// TODO: Handle inputs to move player
|
|
|
|
// TODO: Find a way to go to edges instead of just equally split (?)
|
|
|
|
|
2019-05-27 13:50:49 +02:00
|
|
|
int main()
|
|
|
|
{
|
|
|
|
World world(10,10);
|
|
|
|
world.setBlock(BlockType::AIR,1,1,8,8);
|
|
|
|
world.setBlock(BlockType::WALL,4,4,2,2);
|
2019-06-01 06:42:29 +02:00
|
|
|
world.player.move(2,2);
|
2019-05-27 13:50:49 +02:00
|
|
|
std::cout << world << std::endl;
|
2019-06-01 06:42:29 +02:00
|
|
|
|
|
|
|
sf::RenderWindow window(sf::VideoMode(800,600),"Da raycasting");
|
|
|
|
world.render(window);
|
|
|
|
window.display();
|
|
|
|
|
|
|
|
while (window.isOpen())
|
|
|
|
{
|
|
|
|
sf::Event event;
|
|
|
|
while (window.pollEvent(event))
|
|
|
|
{
|
|
|
|
if (event.type == sf::Event::Closed)
|
|
|
|
window.close();
|
|
|
|
}
|
2024-01-21 22:03:04 +00:00
|
|
|
window.clear();
|
|
|
|
|
|
|
|
world.render(window);
|
|
|
|
window.display();
|
2019-06-01 06:42:29 +02:00
|
|
|
}
|
|
|
|
|
2019-05-27 13:50:49 +02:00
|
|
|
return 0;
|
2023-12-30 14:50:35 +01:00
|
|
|
}
|