diff --git a/src/core.cpp b/src/core.cpp index a4c30bb..0c152ae 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -4,9 +4,16 @@ void Core::init(){ SDL_Init(SDL_INIT_VIDEO); - gWindow = SDL_CreateWindow("Platform Test!",SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,SCREEN_WIDTH,SCREEN_HEIGHT,SDL_WINDOW_SHOWN); - gRenderer = SDL_CreateRenderer(gWindow,-1,SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); - SDL_SetRenderDrawColor(gRenderer,0xFF,0xFF,0xFF,0xFF); + gWindow = SDL_CreateWindow( + "Platform Test!", + SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, + SCREEN_WIDTH,SCREEN_HEIGHT, SDL_WINDOW_SHOWN + ); + + gRenderer = SDL_CreateRenderer( + gWindow, -1, + SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC + ); } void Core::close(){ @@ -27,10 +34,16 @@ int Core::coreInit(){ //-1 = quit, 0 = Menu, 1 = playing, while(gamestate != -1){ - if(gamestate == 0) gamestate = menu(gRenderer); - else if(gamestate == 1) gamestate = maps.map("overworld"); - else gamestate = -1; - + switch(gamestate){ + case 0: + gamestate = menu(gRenderer); + break; + case 1: + gamestate = maps.map("overworld"); + break; + default: + gamestate = -1; + } } close(); diff --git a/src/entity/player.cpp b/src/entity/player.cpp index 6672a22..025f5c9 100644 --- a/src/entity/player.cpp +++ b/src/entity/player.cpp @@ -161,8 +161,6 @@ void Player::move(){ float x = velocityX * dt * run; float y = velocityY * dt; - std::cout << velocityY << " " << posY << " " << y << std::endl; - //Convert and set new int position posX += static_cast(x); posY -= static_cast(y+0.5);