< index < 1. Colors |
===================================== | > 3. System layer |
TCODConsole::initRoot(80,50,"my game",false); TCODSystem::setFps(25); // limit framerate to 25 frames per second while ( ! endGame && ! TCODConsole::isWindowClosed() ) { ... draw on TCODConsole::root TCODConsole::flush(); TCOD_key_t key=TCODConsole::checkForKeypress(); updateWorld( key, TCODSystem::getLastFrameLength() ); // updateWorld(TCOD_key_t key, float elapsed) (using key if key.vk != TCODK_NONE) // use elapsed to scale any update that is time dependant. }
TCODConsole::initRoot(80,50,"my game",false); while ( ! endGame && ! TCODConsole::isWindowClosed() ) { ... draw on TCODConsole::root TCODConsole::flush(); TCOD_key_t key=TCODConsole::waitForKeypress(true); ... update world, using key }