void render() { clearScreen(); // clears the current screen and draw from scratch renderMap(); // renders the map to the buffer first renderCharacter(); // renders the character into the buffer renderFramerate(); // renders debug information, frame rate, elapsed time, etc renderToScreen(); // dump the contents of the buffer to the screen, one frame worth of game }
//-------------------------------------------------------------- // Purpose : Render function is to update the console screen // At this point, you should know exactly what to draw onto the screen. // Just draw it! // To get an idea of the values for colours, look at console.h and the URL listed there // Input : void // Output : void //-------------------------------------------------------------- void render() { clearScreen(); // clears the current screen and draw from scratch switch (g_eGameState) { case S_SPLASHSCREEN: renderSplashScreen(); break; case S_GAME: renderGame(); break; } renderFramerate(); // renders debug information, frame rate, elapsed time, etc renderToScreen(); // dump the contents of the buffer to the screen, one frame worth of game }
/*This is the render loop At this point, you should know exactly what to draw onto the screen, so just draw it! To get an idea of the values for colours, look at console.h and the URL listed there*/ void render() { //Clears the current screen and draw from scratch. clearScreen(); renderMap(); renderShooter(); renderCharacter(mummy.charDirection); renderBoxes(); renderMonsters(); renderMessages(); //Dump the contents of the buffer to the screen. One frame worth of the game. renderToScreen(); }
void renderMainMenu() { clearScreen(); string str; unsigned int lineNumber = 0; std::ifstream file("menu.txt"); { while(getline(file, str)) { console.writeToBuffer(0, lineNumber, str, 0x0F); ++lineNumber; } } if (menuStates != Level_Selection) { unsigned int yCoords = 10; for (unsigned int c = 0; c < numberOfMenuOptions; ++c) { if (options[c].isSelected) { options[c].optionColour = 0xF0; } else { options[c].optionColour = 0x0F; } console.writeToBuffer(textXCoords, yCoords + 6, options[c].displayName, options[c].optionColour); ++yCoords; } } else { renderLevelSelection(); } renderToScreen(); }
/* This is the render loop At this point, you should know exactly what to draw onto the screen. Just draw it! To get an idea of the values for colours, look at console.h and the URL listed there */ void render() { clearScreen(); // clears the current screen and draw from scratch switch (g_eGameState) { case SPLASH: splash(); // splash screen break; case TITLE: titlescreen(); // title screen break; case VICTORY: victory(); // victory screen break; case CREDITS: credits(); // credits & statistics screen break; case PAUSE: pausemenu(); // pause screen break; case CLASSSELECT: classSelect(); // class selection screen break; case GAME: renderGame(); // Game screen break; case GAMEOVER: gameend(); // Retry screen break; } renderToScreen();// dump the contents of the buffer to the screen, one frame worth of game }