Python libtcod on macosx
While I was preparing manual the post was deleted. But it's a pity just to delete it and probably someone else will need it in future. So here it is )
Posted Feb 9, 2016, 8:03 PM UTC · edited
83
While I was preparing manual the post was deleted. But it's a pity just to delete it and probably someone else will need it in future. So here it is )
Posted Feb 9, 2016, 8:03 PM UTC · edited
Awesome, thank you so much man!
1.Need install dependency
For this:
Install Xcode
Install git!
I recommend install macports
From macports install libsdl2 and others. For example:
2.Create directory for libtcod
3.Download libtcod from github
and
5.Run build libtcod
6.In libtcod-mac folder should be appear filse:
7.Create folder for your RL
8.Copy into RL folder files:
9.Create the_best_rl.py file and insert code
import libtcodpy as libtcod
SCREEN_WIDTH = 80
SCREEN_HEIGHT = 50
LIMIT_FPS = 20
libtcod.console_set_custom_font('arial10x10.png', libtcod.FONT_TYPE_GREYSCALE | libtcod.FONT_LAYOUT_TCOD)
libtcod.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, 'python/libtcod tutorial', False)
libtcod.sys_set_fps(LIMIT_FPS)
libtcod.console_set_default_foreground(0, libtcod.white)
libtcod.console_put_char(0, 1, 1, '@', libtcod.BKGND_NONE)
libtcod.console_flush()
while not libtcod.console_is_window_closed():
10.Run:
You should be seen black window with white @ in left-top corner
P.S. sorry for my English
English speakers could have easily provided less understandable instructions. Thanks for your effort.