October 2016
Beginner
520 pages
10h 19m
English
We need a way to stay in the program until the player wants to quit. At the same time, we should clearly mark out where the different parts of our code will go as we progress with Timber!!!. Furthermore, if we are going to stop our game from exiting, we had better provide a way for the player to exit when they are ready. Otherwise the game will go on forever!
Add the highlighted code, inside the existing code, and then we will go through and discuss it all:
int main()
{
// Create a video mode object
VideoMode vm(1920, 1080);
// Create and open a window for the game
RenderWindow window(vm, "Timber!!!", Style::Fullscreen);
while (window.isOpen()) { /* **************************************** Handle the players input **************************************** ...Read now
Unlock full access