Exploring raycasters and possibly make a little "doom like" game based on it.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
raycaster/main.cpp

45 lines
890 B

#include "raycaster.hpp"
static const int SCREEN_HEIGHT=960;
static const int SCREEN_WIDTH=1280;
int main() {
sf::RenderWindow window(sf::VideoMode(SCREEN_WIDTH, SCREEN_HEIGHT), "Zed's Ray Caster Game Thing");
Raycaster rayview(window);
/*
using KB = sf::Keyboard;
rayview.load_textures();
double moveSpeed = 0.1;
double rotSpeed = 0.1;
while(window.isOpen()) {
rayview.render();
if(KB::isKeyPressed(KB::W)) {
rayview.move_forward(moveSpeed);
} else if(KB::isKeyPressed(KB::S)) {
rayview.move_backward(moveSpeed);
}
if(KB::isKeyPressed(KB::D)) {
rayview.rotate_right(rotSpeed);
} else if(KB::isKeyPressed(KB::A)) {
rayview.rotate_left(rotSpeed);
}
sf::Event event;
while(window.pollEvent(event)) {
if(event.type == sf::Event::Closed) {
window.close();
}
}
}
*/
return 0;
}