Difference between revisions of "Talk:Complete Roguelike Tutorial, using python+libtcod, part 1"
Jump to navigation
Jump to search
Slipstream (talk | contribs) (→OS X: new section) |
|||
Line 25: | Line 25: | ||
Thank you! | Thank you! | ||
[[User:SkaryMonk|SkaryMonk]] 13:17, 11 May 2012 (CEST) | [[User:SkaryMonk|SkaryMonk]] 13:17, 11 May 2012 (CEST) | ||
== OS X == | |||
N00b here. I'm having a difficult time translating this tutorial for OS X 10.6.8. I've downloaded an OS X version of the libtcod library, but I'm not sure which files to put in the working directory. I'm not sure if I have to install libtcod onto my system in some more general way, and if so, how I would do that. | |||
Could anyone give a quick rundown of that process? |
Revision as of 22:15, 1 November 2014
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)
- Done. Had to manually update about 10 "whole code" pages but it's for the better, I never liked that logic anyway. Jotaf 22:35, 7 November 2010 (UTC)
I'm very much enjoying this tutorial! It is immensely helpful and informative. However, I have two questions, that I, as a python-noob, don't understand:
- libtcod.console_flush() comes before the code that overwrites the '@' with ' '. Doesn't that mean, that the old character gets overwritten AFTER the output? I don't understand how that works.
- When I press left arrow, and then up right after, my @ moves left two times and up once. Is that because of console_is_key_pressed? Is that the way it's supposed to work?
Thank you! SkaryMonk 13:17, 11 May 2012 (CEST)
OS X
N00b here. I'm having a difficult time translating this tutorial for OS X 10.6.8. I've downloaded an OS X version of the libtcod library, but I'm not sure which files to put in the working directory. I'm not sure if I have to install libtcod onto my system in some more general way, and if so, how I would do that.
Could anyone give a quick rundown of that process?