Talk:Complete Roguelike Tutorial, using python+libtcod, part 1

From RogueBasin
Revision as of 16:24, 23 October 2010 by Jotaf (talk | contribs)
Jump to navigation Jump to search

Instead of the awkward

    if not first_time:

may I suggest to just put things in the order in which they are meant to be executed?

    libtcod.console_set_foreground_color(0, libtcod.white)
    libtcod.console_print_left(0, playerx, playery, libtcod.BKGND_NONE, '@')
    libtcod.console_flush()
    libtcod.console_print_left(0, playerx, playery, libtcod.BKGND_NONE, ' ')

    exit = handle_keys()
    if exit:
        break

-- relet 16:48, 18 October 2010 (UTC)

Sure. The logic you're pointing out was only added as an afterthought to correct a small bug: the first frame for a turn-based game wouldn't be shown while waiting for input. When someone pointed out the bug this was added as a quick-fix. I'll change it to the better solution soon (remember I also have to make the same change to all the "whole code" pages...). Jotaf 16:24, 23 October 2010 (UTC)