This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# To the extent possible under law, the Kyle Stewart has waived all | |
# copyright and related or neighboring rights for starfield.py. This work is | |
# published from: United States. | |
# https://creativecommons.org/publicdomain/zero/1.0/ | |
import random | |
import math | |
import tcod | |
import tcod.event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To the extent possible under law, Kyle Stewart has waived all copyright and | |
# related or neighboring rights to this work. | |
# This work is published from: United States. | |
import functools | |
from typing import Any, Tuple | |
import numpy as np # type: ignore | |
@functools.lru_cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Python-tcod map attribute benchmarks for pytest-benchmark. | |
This test should be run with the Python optimize flag set. | |
Not doing so will slow down tcod.map_set_properties since it will emit | |
warnings on every call. | |
""" | |
import tcod | |
import numpy as np | |
tile_list = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tcod | |
import tcod.render | |
# Font file is at https://github.com/libtcod/python-tcod/blob/4385a4d65f20a6e1eefc8ab0a243c0d869adec45/fonts/libtcod/dejavu16x16_gs_tc.png | |
FONT = "dejavu16x16_gs_tc.png" | |
tileset = tcod.tileset.load_tilesheet(FONT, 32, 8, tcod.tileset.CHARMAP_TCOD) | |
console = tcod.Console(20, 8) | |
console.print(0, 0, "Hello World") | |
sdl_window = tcod.sdl.video.new_window( | |
console.width * tileset.tile_width, |