pkulev / xoinvader

Python space game in terminal
http://mmap.me
MIT License
12 stars 1 forks source link

Implement file format for text images #82

Closed pkulev closed 4 years ago

pkulev commented 4 years ago

Abstract

We need file format to keep 3 things together:

Application itself must register colors and attributes it uses or just use defaults.

Example

[meta]
name = "kekstrel"

[layers]
image = """
  O  
<=H=>
 * * 
"""

# w is white
# b is blue
color = """
  w  
wwwww
 b b 
"""

# n is normal
# B is bold
attr = """
  n  
nnnnn
 B B 
"""

Implementation

Add classmethod Surface.from_file(). Replace hardcoded images with files, set path to them in corresponding configs.