Esempio n. 1
0
	def draw(self):

		for y in range(self.size['y']):
			for x in range(self.size['x']):
				blocked = 1
				visible = 1
				if self.map[x][y].blocked: blocked = 0
				#if self.map[x][y].block_sight: visible = 0
				if ltc.map_is_in_fov(self.map_fov,x,y): visible = 0
				ltc.console_set_char_background(self.con,x,y,constants.colors['tiles'][self.map[x][y].tile_type][blocked][visible],ltc.BKGND_SET)
	def draw(self):
		should_equal_none = None

		if self.blinks:
			if self.blink_timer > (self.blink_frequency/2):
				# doesn't draw for this portion of the cycle
				should_equal_none = False
				
				# resets the blink_timer if it goes through the entire cycle
				if self.blink_timer > self.blink_frequency:
					self.blink_timer = 0
		
		if should_equal_none is None:
			ltc.console_set_char_background(self.con, self.pos_x, self.pos_y,ltc.Color(100, 100, 100), ltc.BKGND_SET)
Esempio n. 3
0
	def render_map(self, con):
		for y in range(self.height):
			for x in range(self.width):
				color = self.color['dark_ground']

				if self.map[x][y].blocked:
					color = self.color['dark_wall']

				tcod.console_set_char_background(con, x, y, color, tcod.BKGND_SET)
				tcod.console_set_char(con, x, y, tcod.CHAR_BLOCK1)

		if parser.OPTIONS['game']['debug'] is True:
			barf.Barf('DBG', 'Map rendered')

		return self.map