Libtcod in Python...I have a lot of doubts

Libtcod in Python...I have a lot of doubts

Postby mdtrooper » 30 May 2014, 00:19

I am starting to learning libtcod (a library for to make easy develop roguelikes)...but it is dificult...

I have a lot of doubts.

Now, I am trying to load the "map" from the txt file but the result is a black window. This is the code:
{l Code}: {l Select All Code}
import libtcodpy as libtcod
 
#actual size of the window
SCREEN_WIDTH = 80
SCREEN_HEIGHT = 50
 
LIMIT_FPS = 20  #20 frames-per-second maximum

ftl01 = libtcod.image_load("ftl01.png")
 
libtcod.console_set_custom_font('arial8x8.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)


offscreen_console = libtcod.console_new(80, 50)
libtcod.console_load_asc(offscreen_console, "caca.asc")



 
while not libtcod.console_is_window_closed():
 
    libtcod.console_set_default_foreground(0, libtcod.white)
 
    libtcod.console_put_char(0, 1, 1, '@', libtcod.BKGND_NONE)
       
    libtcod.image_blit_rect(ftl01, 0, 0, 0, -1, -1, libtcod.BKGND_SET)
    #~ libtcod.console_blit(offscreen_console, 0, 0, 0, 0, 0, 0, 0)
 
    libtcod.console_flush()
And I have a Patreon in https://www.patreon.com/migueldedios.
User avatar
mdtrooper
 
Posts: 185
Joined: 26 Jul 2012, 13:24
Location: Spain

Who is online

Users browsing this forum: No registered users and 1 guest