| @@ 830-843 (lines=14) @@ | ||
| 827 | libtcod.console_set_char_background(sample_console, x, y, fov_dark_ground, |
|
| 828 | libtcod.BKGND_SET) |
|
| 829 | # draw the path |
|
| 830 | if path_using_astar : |
|
| 831 | for i in range(libtcod.path_size(path)): |
|
| 832 | x,y = libtcod.path_get(path, i) |
|
| 833 | libtcod.console_set_char_background(sample_console, x, y, |
|
| 834 | fov_light_ground, libtcod.BKGND_SET) |
|
| 835 | else: |
|
| 836 | for y in range(SAMPLE_SCREEN_HEIGHT): |
|
| 837 | for x in range(SAMPLE_SCREEN_WIDTH): |
|
| 838 | if smap[y][x] != '#': |
|
| 839 | libtcod.console_set_char_background(sample_console, x, y, libtcod.color_lerp(fov_light_ground,fov_dark_ground, |
|
| 840 | 0.9 * libtcod.dijkstra_get_distance(path_dijk,x,y) / path_dijk_dist), libtcod.BKGND_SET) |
|
| 841 | for i in range(libtcod.dijkstra_size(path_dijk)): |
|
| 842 | x,y=libtcod.dijkstra_get(path_dijk,i) |
|
| 843 | libtcod.console_set_char_background(sample_console,x,y,fov_light_ground, libtcod.BKGND_SET ) |
|
| 844 | ||
| 845 | # move the creature |
|
| 846 | path_busy -= libtcod.sys_get_last_frame_length() |
|
| @@ 670-683 (lines=14) @@ | ||
| 667 | libtcod.console_set_char_background(sample_console, x, y, DARK_GROUND, |
|
| 668 | libtcod.BKGND_SET) |
|
| 669 | # draw the path |
|
| 670 | if self.using_astar : |
|
| 671 | for i in range(libtcod.path_size(self.path)): |
|
| 672 | x,y = libtcod.path_get(self.path, i) |
|
| 673 | libtcod.console_set_char_background(sample_console, x, y, |
|
| 674 | LIGHT_GROUND, libtcod.BKGND_SET) |
|
| 675 | else: |
|
| 676 | for y in range(SAMPLE_SCREEN_HEIGHT): |
|
| 677 | for x in range(SAMPLE_SCREEN_WIDTH): |
|
| 678 | if SAMPLE_MAP[y][x] != '#': |
|
| 679 | libtcod.console_set_char_background(sample_console, x, y, libtcod.color_lerp(LIGHT_GROUND,DARK_GROUND, |
|
| 680 | 0.9 * libtcod.dijkstra_get_distance(self.dijk,x,y) / self.dijk_dist), libtcod.BKGND_SET) |
|
| 681 | for i in range(libtcod.dijkstra_size(self.dijk)): |
|
| 682 | x,y=libtcod.dijkstra_get(self.dijk,i) |
|
| 683 | libtcod.console_set_char_background(sample_console,x,y,LIGHT_GROUND, libtcod.BKGND_SET ) |
|
| 684 | ||
| 685 | # move the creature |
|
| 686 | self.busy -= libtcod.sys_get_last_frame_length() |
|