Compare commits
7 Commits
9ee613c68b
...
81b04aac37
Author | SHA1 | Date | |
---|---|---|---|
81b04aac37 | |||
cb4635299e | |||
fbb48036b5 | |||
12acaf0301 | |||
ed029e892a | |||
b0ef90953d | |||
6f8fe45a0e |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
/target
|
/target
|
||||||
|
**/.DS_Store
|
||||||
|
@ -8,6 +8,9 @@ edition = "2021"
|
|||||||
[[bin]]
|
[[bin]]
|
||||||
name = "first_app"
|
name = "first_app"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "tetris"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "minesweeper"
|
name = "minesweeper"
|
||||||
|
|
||||||
|
1
assets/fonts/monogram/bitmap/monogram-bitfontmaker.json
Normal file
1
assets/fonts/monogram/bitmap/monogram-bitfontmaker.json
Normal file
File diff suppressed because one or more lines are too long
392
assets/fonts/monogram/bitmap/monogram-bitmap.json
Normal file
392
assets/fonts/monogram/bitmap/monogram-bitmap.json
Normal file
@ -0,0 +1,392 @@
|
|||||||
|
{
|
||||||
|
"0":[0,0,0,14,17,25,21,19,17,14,0,0],
|
||||||
|
"1":[0,0,0,4,6,4,4,4,4,31,0,0],
|
||||||
|
"2":[0,0,0,14,17,16,8,4,2,31,0,0],
|
||||||
|
"3":[0,0,0,14,17,16,12,16,17,14,0,0],
|
||||||
|
"4":[0,0,0,18,18,17,31,16,16,16,0,0],
|
||||||
|
"5":[0,0,0,31,1,15,16,16,17,14,0,0],
|
||||||
|
"6":[0,0,0,14,1,1,15,17,17,14,0,0],
|
||||||
|
"7":[0,0,0,31,16,16,8,4,4,4,0,0],
|
||||||
|
"8":[0,0,0,14,17,17,14,17,17,14,0,0],
|
||||||
|
"9":[0,0,0,14,17,17,30,16,17,14,0,0],
|
||||||
|
"!":[0,0,0,4,4,4,4,4,0,4,0,0],
|
||||||
|
"\"":[0,0,0,10,10,10,0,0,0,0,0,0],
|
||||||
|
"#":[0,0,0,0,10,31,10,10,31,10,0,0],
|
||||||
|
"$":[0,0,0,4,30,5,14,20,15,4,0,0],
|
||||||
|
"%":[0,0,0,17,17,8,4,2,17,17,0,0],
|
||||||
|
"&":[0,0,0,6,9,9,30,9,9,22,0,0],
|
||||||
|
"'":[0,0,0,4,4,4,0,0,0,0,0,0],
|
||||||
|
"(":[0,0,0,8,4,4,4,4,4,8,0,0],
|
||||||
|
")":[0,0,0,2,4,4,4,4,4,2,0,0],
|
||||||
|
"*":[0,0,0,0,4,21,14,21,4,0,0,0],
|
||||||
|
"+":[0,0,0,0,4,4,31,4,4,0,0,0],
|
||||||
|
",":[0,0,0,0,0,0,0,0,4,4,2,0],
|
||||||
|
"-":[0,0,0,0,0,0,31,0,0,0,0,0],
|
||||||
|
".":[0,0,0,0,0,0,0,0,4,4,0,0],
|
||||||
|
"/":[0,0,0,16,16,8,4,2,1,1,0,0],
|
||||||
|
":":[0,0,0,0,4,4,0,0,4,4,0,0],
|
||||||
|
";":[0,0,0,0,4,4,0,0,4,4,2,0],
|
||||||
|
"<":[0,0,0,0,24,6,1,6,24,0,0,0],
|
||||||
|
"=":[0,0,0,0,0,31,0,31,0,0,0,0],
|
||||||
|
">":[0,0,0,0,3,12,16,12,3,0,0,0],
|
||||||
|
"?":[0,0,0,14,17,16,8,4,0,4,0,0],
|
||||||
|
"@":[0,0,0,14,25,21,21,25,1,14,0,0],
|
||||||
|
"A":[0,0,0,14,17,17,17,31,17,17,0,0],
|
||||||
|
"B":[0,0,0,15,17,17,15,17,17,15,0,0],
|
||||||
|
"C":[0,0,0,14,17,1,1,1,17,14,0,0],
|
||||||
|
"D":[0,0,0,15,17,17,17,17,17,15,0,0],
|
||||||
|
"E":[0,0,0,31,1,1,15,1,1,31,0,0],
|
||||||
|
"F":[0,0,0,31,1,1,15,1,1,1,0,0],
|
||||||
|
"G":[0,0,0,14,17,1,29,17,17,14,0,0],
|
||||||
|
"H":[0,0,0,17,17,17,31,17,17,17,0,0],
|
||||||
|
"I":[0,0,0,31,4,4,4,4,4,31,0,0],
|
||||||
|
"J":[0,0,0,16,16,16,16,17,17,14,0,0],
|
||||||
|
"K":[0,0,0,17,9,5,3,5,9,17,0,0],
|
||||||
|
"L":[0,0,0,1,1,1,1,1,1,31,0,0],
|
||||||
|
"M":[0,0,0,17,27,21,17,17,17,17,0,0],
|
||||||
|
"N":[0,0,0,17,17,19,21,25,17,17,0,0],
|
||||||
|
"O":[0,0,0,14,17,17,17,17,17,14,0,0],
|
||||||
|
"P":[0,0,0,15,17,17,15,1,1,1,0,0],
|
||||||
|
"Q":[0,0,0,14,17,17,17,17,17,14,24,0],
|
||||||
|
"R":[0,0,0,15,17,17,15,17,17,17,0,0],
|
||||||
|
"S":[0,0,0,14,17,1,14,16,17,14,0,0],
|
||||||
|
"T":[0,0,0,31,4,4,4,4,4,4,0,0],
|
||||||
|
"U":[0,0,0,17,17,17,17,17,17,14,0,0],
|
||||||
|
"V":[0,0,0,17,17,17,17,10,10,4,0,0],
|
||||||
|
"W":[0,0,0,17,17,17,17,21,27,17,0,0],
|
||||||
|
"X":[0,0,0,17,17,10,4,10,17,17,0,0],
|
||||||
|
"Y":[0,0,0,17,17,10,4,4,4,4,0,0],
|
||||||
|
"Z":[0,0,0,31,16,8,4,2,1,31,0,0],
|
||||||
|
"[":[0,0,0,12,4,4,4,4,4,12,0,0],
|
||||||
|
"\\":[0,0,0,1,1,2,4,8,16,16,0,0],
|
||||||
|
"]":[0,0,0,6,4,4,4,4,4,6,0,0],
|
||||||
|
"^":[0,0,0,4,10,17,0,0,0,0,0,0],
|
||||||
|
"_":[0,0,0,0,0,0,0,0,0,31,0,0],
|
||||||
|
"`":[0,0,0,2,4,0,0,0,0,0,0,0],
|
||||||
|
"a":[0,0,0,0,0,30,17,17,17,30,0,0],
|
||||||
|
"b":[0,0,0,1,1,15,17,17,17,15,0,0],
|
||||||
|
"c":[0,0,0,0,0,14,17,1,17,14,0,0],
|
||||||
|
"d":[0,0,0,16,16,30,17,17,17,30,0,0],
|
||||||
|
"e":[0,0,0,0,0,14,17,31,1,14,0,0],
|
||||||
|
"f":[0,0,0,12,18,2,15,2,2,2,0,0],
|
||||||
|
"g":[0,0,0,0,0,30,17,17,17,30,16,14],
|
||||||
|
"h":[0,0,0,1,1,15,17,17,17,17,0,0],
|
||||||
|
"i":[0,0,0,4,0,6,4,4,4,31,0,0],
|
||||||
|
"j":[0,0,0,16,0,24,16,16,16,16,17,14],
|
||||||
|
"k":[0,0,0,1,1,17,9,7,9,17,0,0],
|
||||||
|
"l":[0,0,0,3,2,2,2,2,2,28,0,0],
|
||||||
|
"m":[0,0,0,0,0,15,21,21,21,21,0,0],
|
||||||
|
"n":[0,0,0,0,0,15,17,17,17,17,0,0],
|
||||||
|
"o":[0,0,0,0,0,14,17,17,17,14,0,0],
|
||||||
|
"p":[0,0,0,0,0,15,17,17,17,15,1,1],
|
||||||
|
"q":[0,0,0,0,0,30,17,17,17,30,16,16],
|
||||||
|
"r":[0,0,0,0,0,13,19,1,1,1,0,0],
|
||||||
|
"s":[0,0,0,0,0,30,1,14,16,15,0,0],
|
||||||
|
"t":[0,0,0,2,2,15,2,2,2,28,0,0],
|
||||||
|
"u":[0,0,0,0,0,17,17,17,17,30,0,0],
|
||||||
|
"v":[0,0,0,0,0,17,17,17,10,4,0,0],
|
||||||
|
"w":[0,0,0,0,0,17,17,21,21,10,0,0],
|
||||||
|
"x":[0,0,0,0,0,17,10,4,10,17,0,0],
|
||||||
|
"y":[0,0,0,0,0,17,17,17,17,30,16,14],
|
||||||
|
"z":[0,0,0,0,0,31,8,4,2,31,0,0],
|
||||||
|
"{":[0,0,0,8,4,4,2,4,4,8,0,0],
|
||||||
|
"|":[0,0,0,4,4,4,4,4,4,4,0,0],
|
||||||
|
"}":[0,0,0,2,4,4,8,4,4,2,0,0],
|
||||||
|
"~":[0,0,0,0,0,18,13,0,0,0,0,0],
|
||||||
|
"¡":[0,0,0,4,0,4,4,4,4,4,0,0],
|
||||||
|
"¢":[0,0,0,4,14,21,5,21,14,4,0,0],
|
||||||
|
"£":[0,0,0,12,18,2,15,2,2,31,0,0],
|
||||||
|
"¤":[0,0,0,0,17,14,10,14,17,0,0,0],
|
||||||
|
"¥":[0,0,0,17,10,4,31,4,31,4,0,0],
|
||||||
|
"¦":[0,0,0,4,4,4,0,4,4,4,0,0],
|
||||||
|
"§":[0,0,0,30,1,14,17,14,16,15,0,0],
|
||||||
|
"¨":[0,0,0,10,0,0,0,0,0,0,0,0],
|
||||||
|
"©":[0,0,0,14,27,21,29,21,27,14,0,0],
|
||||||
|
"ª":[0,0,0,14,9,9,9,14,0,0,0,0],
|
||||||
|
"«":[0,0,0,0,0,18,9,18,0,0,0,0],
|
||||||
|
"¬":[0,0,0,0,0,0,31,16,0,0,0,0],
|
||||||
|
"®":[0,0,0,14,25,21,21,25,21,14,0,0],
|
||||||
|
"¯":[0,0,0,0,0,0,31,0,0,0,0,0],
|
||||||
|
"°":[0,0,0,6,9,9,6,0,0,0,0,0],
|
||||||
|
"±":[0,0,0,4,4,31,4,4,0,31,0,0],
|
||||||
|
"²":[0,0,0,3,4,2,1,7,0,0,0,0],
|
||||||
|
"³":[0,0,0,3,4,2,4,3,0,0,0,0],
|
||||||
|
"´":[0,0,8,4,0,0,0,0,0,0,0,0],
|
||||||
|
"µ":[0,0,0,0,0,17,17,17,17,15,1,1],
|
||||||
|
"¶":[0,0,0,30,23,23,23,22,20,20,0,0],
|
||||||
|
"·":[0,0,0,4,0,0,0,0,0,0,0,0],
|
||||||
|
"¸":[0,0,0,0,0,0,0,0,0,4,8,6],
|
||||||
|
"¹":[0,0,0,2,3,2,2,7,0,0,0,0],
|
||||||
|
"º":[0,0,0,6,9,9,9,6,0,0,0,0],
|
||||||
|
"»":[0,0,0,0,0,9,18,9,0,0,0,0],
|
||||||
|
"¼":[0,0,0,1,9,5,2,21,28,16,0,0],
|
||||||
|
"½":[0,0,0,1,9,5,14,17,8,28,0,0],
|
||||||
|
"¾":[0,0,0,7,22,15,4,22,29,16,0,0],
|
||||||
|
"¿":[0,0,0,4,0,4,2,1,17,14,0,0],
|
||||||
|
"À":[2,4,0,14,17,17,31,17,17,17,0,0],
|
||||||
|
"Á":[8,4,0,14,17,17,31,17,17,17,0,0],
|
||||||
|
"Â":[4,10,0,14,17,17,31,17,17,17,0,0],
|
||||||
|
"Ã":[22,9,0,14,17,17,31,17,17,17,0,0],
|
||||||
|
"Ä":[0,10,0,14,17,17,31,17,17,17,0,0],
|
||||||
|
"Å":[4,10,4,14,17,17,31,17,17,17,0,0],
|
||||||
|
"Æ":[0,0,0,30,5,5,31,5,5,29,0,0],
|
||||||
|
"Ç":[0,0,0,14,17,1,1,1,17,14,8,6],
|
||||||
|
"È":[2,4,0,31,1,1,15,1,1,31,0,0],
|
||||||
|
"É":[8,4,0,31,1,1,15,1,1,31,0,0],
|
||||||
|
"Ê":[4,10,0,31,1,1,15,1,1,31,0,0],
|
||||||
|
"Ë":[0,10,0,31,1,1,15,1,1,31,0,0],
|
||||||
|
"Ì":[2,4,0,31,4,4,4,4,4,31,0,0],
|
||||||
|
"Í":[8,4,0,31,4,4,4,4,4,31,0,0],
|
||||||
|
"Î":[4,10,0,31,4,4,4,4,4,31,0,0],
|
||||||
|
"Ï":[0,10,0,31,4,4,4,4,4,31,0,0],
|
||||||
|
"Ð":[0,0,0,15,17,17,19,17,17,15,0,0],
|
||||||
|
"Ñ":[22,9,0,17,17,19,21,25,17,17,0,0],
|
||||||
|
"Ò":[2,4,0,14,17,17,17,17,17,14,0,0],
|
||||||
|
"Ó":[8,4,0,14,17,17,17,17,17,14,0,0],
|
||||||
|
"Ô":[4,10,0,14,17,17,17,17,17,14,0,0],
|
||||||
|
"Õ":[22,9,0,14,17,17,17,17,17,14,0,0],
|
||||||
|
"Ö":[0,10,0,14,17,17,17,17,17,14,0,0],
|
||||||
|
"×":[0,0,0,0,0,0,10,4,10,0,0,0],
|
||||||
|
"Ø":[0,0,0,22,9,25,21,19,18,13,0,0],
|
||||||
|
"Ù":[2,4,0,17,17,17,17,17,17,14,0,0],
|
||||||
|
"Ú":[8,4,0,17,17,17,17,17,17,14,0,0],
|
||||||
|
"Û":[4,10,0,17,17,17,17,17,17,14,0,0],
|
||||||
|
"Ü":[0,10,0,17,17,17,17,17,17,14,0,0],
|
||||||
|
"Ý":[8,4,0,17,17,10,4,4,4,4,0,0],
|
||||||
|
"Þ":[0,0,0,1,15,17,17,17,15,1,0,0],
|
||||||
|
"ß":[0,0,0,6,9,9,13,17,17,13,0,0],
|
||||||
|
"à":[0,0,2,4,0,30,17,17,17,30,0,0],
|
||||||
|
"á":[0,0,8,4,0,30,17,17,17,30,0,0],
|
||||||
|
"â":[0,0,4,10,0,30,17,17,17,30,0,0],
|
||||||
|
"ã":[0,0,22,9,0,30,17,17,17,30,0,0],
|
||||||
|
"ä":[0,0,0,10,0,30,17,17,17,30,0,0],
|
||||||
|
"å":[0,4,10,4,0,30,17,17,17,30,0,0],
|
||||||
|
"æ":[0,0,0,0,0,14,21,29,5,30,0,0],
|
||||||
|
"ç":[0,0,0,0,0,14,17,1,17,14,8,6],
|
||||||
|
"è":[0,0,2,4,0,14,17,31,1,14,0,0],
|
||||||
|
"é":[0,0,8,4,0,14,17,31,1,14,0,0],
|
||||||
|
"ê":[0,0,4,10,0,14,17,31,1,14,0,0],
|
||||||
|
"ë":[0,0,0,10,0,14,17,31,1,14,0,0],
|
||||||
|
"ì":[0,0,2,4,0,6,4,4,4,31,0,0],
|
||||||
|
"í":[0,0,8,4,0,6,4,4,4,31,0,0],
|
||||||
|
"î":[0,0,4,10,0,6,4,4,4,31,0,0],
|
||||||
|
"ï":[0,0,0,10,0,6,4,4,4,31,0,0],
|
||||||
|
"ð":[0,0,14,48,24,30,17,17,17,14,0,0],
|
||||||
|
"ñ":[0,0,22,9,0,15,17,17,17,17,0,0],
|
||||||
|
"ò":[0,0,2,4,0,14,17,17,17,14,0,0],
|
||||||
|
"ó":[0,0,8,4,0,14,17,17,17,14,0,0],
|
||||||
|
"ô":[0,0,4,10,0,14,17,17,17,14,0,0],
|
||||||
|
"õ":[0,0,22,9,0,14,17,17,17,14,0,0],
|
||||||
|
"ö":[0,0,0,10,0,14,17,17,17,14,0,0],
|
||||||
|
"÷":[0,0,0,0,0,4,0,31,0,4,0,0],
|
||||||
|
"ø":[0,0,0,0,0,22,9,21,18,13,0,0],
|
||||||
|
"ù":[0,0,2,4,0,17,17,17,17,30,0,0],
|
||||||
|
"ú":[0,0,8,4,0,17,17,17,17,30,0,0],
|
||||||
|
"û":[0,0,4,10,0,17,17,17,17,30,0,0],
|
||||||
|
"ü":[0,0,0,10,0,17,17,17,17,30,0,0],
|
||||||
|
"ý":[0,0,8,4,0,17,17,17,17,30,16,14],
|
||||||
|
"þ":[0,0,0,1,1,15,17,17,17,15,1,1],
|
||||||
|
"ÿ":[0,0,0,10,0,17,17,17,17,30,16,14],
|
||||||
|
"Ā":[0,14,0,14,17,17,31,17,17,17,0,0],
|
||||||
|
"ā":[0,0,0,14,0,30,17,17,17,30,0,0],
|
||||||
|
"Ă":[10,4,0,14,17,17,31,17,17,17,0,0],
|
||||||
|
"ă":[0,0,10,4,0,30,17,17,17,30,0,0],
|
||||||
|
"Ą":[0,0,0,14,17,17,31,17,17,17,8,16],
|
||||||
|
"ą":[0,0,0,0,0,30,17,17,17,30,4,24],
|
||||||
|
"Ć":[8,4,0,14,17,1,1,1,17,14,0,0],
|
||||||
|
"ć":[0,0,8,4,0,14,17,1,17,14,0,0],
|
||||||
|
"Ĉ":[4,10,0,14,17,1,1,1,17,14,0,0],
|
||||||
|
"ĉ":[0,0,4,10,0,14,17,1,17,14,0,0],
|
||||||
|
"Ċ":[0,4,0,14,17,1,1,1,17,14,0,0],
|
||||||
|
"ċ":[0,0,0,4,0,14,17,1,17,14,0,0],
|
||||||
|
"Č":[10,4,0,14,17,1,1,1,17,14,0,0],
|
||||||
|
"č":[0,0,10,4,0,14,17,1,17,14,0,0],
|
||||||
|
"Ď":[10,4,0,15,17,17,17,17,17,15,0,0],
|
||||||
|
"ď":[0,0,80,80,16,30,17,17,17,30,0,0],
|
||||||
|
"Đ":[0,0,0,15,17,17,19,17,17,15,0,0],
|
||||||
|
"đ":[0,0,16,60,16,30,17,17,17,30,0,0],
|
||||||
|
"Ē":[0,14,0,31,1,1,7,1,1,31,0,0],
|
||||||
|
"ē":[0,0,0,14,0,14,17,31,1,14,0,0],
|
||||||
|
"Ĕ":[10,4,0,31,1,1,7,1,1,31,0,0],
|
||||||
|
"ĕ":[0,0,10,4,0,14,17,31,1,14,0,0],
|
||||||
|
"Ė":[0,4,0,31,1,1,7,1,1,31,0,0],
|
||||||
|
"ė":[0,0,0,4,0,14,17,31,1,14,0,0],
|
||||||
|
"Ę":[0,0,0,31,1,1,7,1,1,31,4,24],
|
||||||
|
"ę":[0,0,0,0,0,14,17,31,1,30,4,24],
|
||||||
|
"Ě":[0,14,0,31,1,1,7,1,1,31,0,0],
|
||||||
|
"ě":[0,0,0,10,0,14,17,31,1,14,0,0],
|
||||||
|
"Ĝ":[4,10,0,14,17,1,29,17,17,14,0,0],
|
||||||
|
"ĝ":[0,0,4,10,0,30,17,17,17,30,16,14],
|
||||||
|
"Ğ":[10,4,0,14,17,1,29,17,17,14,0,0],
|
||||||
|
"ğ":[0,0,10,4,0,30,17,17,17,30,16,14],
|
||||||
|
"Ġ":[0,4,0,14,17,1,29,17,17,14,0,0],
|
||||||
|
"ġ":[0,0,0,4,0,30,17,17,17,30,16,14],
|
||||||
|
"Ģ":[0,0,0,14,17,1,29,17,17,14,8,6],
|
||||||
|
"ģ":[0,0,8,4,0,30,17,17,17,30,16,14],
|
||||||
|
"Ĥ":[4,10,0,17,17,17,31,17,17,17,0,0],
|
||||||
|
"ĥ":[0,0,8,21,1,15,17,17,17,17,0,0],
|
||||||
|
"Ħ":[0,0,0,17,63,17,31,17,17,17,0,0],
|
||||||
|
"ħ":[0,0,0,1,3,1,15,17,17,17,0,0],
|
||||||
|
"Ĩ":[22,9,0,31,4,4,4,4,4,31,0,0],
|
||||||
|
"ĩ":[0,0,22,9,0,6,4,4,4,31,0,0],
|
||||||
|
"Ī":[0,14,0,31,4,4,4,4,4,31,0,0],
|
||||||
|
"ī":[0,0,0,14,0,6,4,4,4,31,0,0],
|
||||||
|
"Ĭ":[10,4,0,31,4,4,4,4,4,31,0,0],
|
||||||
|
"ĭ":[0,0,10,4,0,6,4,4,4,31,0,0],
|
||||||
|
"Į":[0,0,0,31,4,4,4,4,4,31,4,24],
|
||||||
|
"į":[0,0,0,4,0,6,4,4,4,31,4,24],
|
||||||
|
"İ":[22,9,0,31,4,4,4,4,4,31,0,0],
|
||||||
|
"ı":[0,0,0,0,0,6,4,4,4,31,0,0],
|
||||||
|
"IJ":[0,0,0,23,18,18,18,18,18,15,0,0],
|
||||||
|
"ij":[0,0,0,18,0,27,18,18,18,31,16,14],
|
||||||
|
"Ĵ":[4,10,0,16,16,16,16,17,17,14,0,0],
|
||||||
|
"ĵ":[0,0,16,40,0,24,16,16,16,16,17,14],
|
||||||
|
"Ķ":[0,0,0,17,9,5,3,5,9,17,4,4],
|
||||||
|
"ķ":[0,0,0,1,1,17,9,7,9,17,4,4],
|
||||||
|
"ĸ":[0,0,0,0,0,17,9,7,9,17,0,0],
|
||||||
|
"Ĺ":[8,4,0,1,1,1,1,1,1,31,0,0],
|
||||||
|
"ĺ":[8,4,0,31,4,4,4,4,4,31,0,0],
|
||||||
|
"Ļ":[0,0,0,1,1,1,1,1,1,31,8,6],
|
||||||
|
"ļ":[0,0,0,31,4,4,4,4,4,31,8,6],
|
||||||
|
"Ľ":[0,0,0,17,17,9,1,1,1,31,0,0],
|
||||||
|
"ľ":[0,0,0,19,18,10,2,2,2,28,0,0],
|
||||||
|
"Ŀ":[0,0,0,1,1,1,9,1,1,31,0,0],
|
||||||
|
"ŀ":[0,0,0,3,2,2,10,2,2,28,0,0],
|
||||||
|
"Ł":[0,0,0,1,1,1,3,1,1,31,0,0],
|
||||||
|
"ł":[0,0,0,3,2,2,6,3,2,28,0,0],
|
||||||
|
"Ń":[8,4,0,17,17,19,21,25,17,17,0,0],
|
||||||
|
"ń":[0,0,8,4,0,15,17,17,17,17,0,0],
|
||||||
|
"Ņ":[0,0,0,17,17,19,21,25,17,17,4,3],
|
||||||
|
"ņ":[0,0,0,0,0,15,17,17,17,17,4,3],
|
||||||
|
"Ň":[10,4,0,17,17,19,21,25,17,17,0,0],
|
||||||
|
"ň":[0,0,10,4,0,15,17,17,17,17,0,0],
|
||||||
|
"ʼn":[0,0,0,0,0,15,17,17,17,17,0,0],
|
||||||
|
"Ŋ":[0,0,0,17,17,19,21,25,17,17,16,12],
|
||||||
|
"ŋ":[0,0,0,0,0,15,17,17,17,17,16,12],
|
||||||
|
"Ō":[0,14,0,14,17,17,17,17,17,14,0,0],
|
||||||
|
"ō":[0,0,0,14,0,14,17,17,17,14,0,0],
|
||||||
|
"Ŏ":[10,4,0,14,17,17,17,17,17,14,0,0],
|
||||||
|
"ŏ":[0,0,10,4,0,14,17,17,17,14,0,0],
|
||||||
|
"Ő":[20,10,0,14,17,17,17,17,17,14,0,0],
|
||||||
|
"ő":[0,0,20,10,0,14,17,17,17,14,0,0],
|
||||||
|
"Œ":[0,0,0,30,5,5,29,5,5,30,0,0],
|
||||||
|
"œ":[0,0,0,0,0,14,21,29,5,14,0,0],
|
||||||
|
"Ŕ":[8,4,0,15,17,17,15,17,17,17,0,0],
|
||||||
|
"ŕ":[0,0,8,4,0,13,19,1,1,1,0,0],
|
||||||
|
"Ŗ":[0,0,0,15,17,17,15,17,17,17,4,3],
|
||||||
|
"ŗ":[0,0,0,0,0,13,19,1,1,1,4,3],
|
||||||
|
"Ř":[10,4,0,15,17,17,15,17,17,17,0,0],
|
||||||
|
"ř":[0,0,10,4,0,13,19,1,1,1,0,0],
|
||||||
|
"Ś":[8,4,0,14,17,1,14,16,17,14,0,0],
|
||||||
|
"ś":[0,0,8,4,0,30,1,14,16,15,0,0],
|
||||||
|
"Ŝ":[4,10,0,14,17,1,14,16,17,14,0,0],
|
||||||
|
"ŝ":[0,0,4,10,0,30,1,14,16,15,0,0],
|
||||||
|
"Ş":[0,0,0,14,17,1,14,16,17,14,4,3],
|
||||||
|
"ş":[0,0,0,0,0,30,1,14,16,15,4,3],
|
||||||
|
"Š":[10,4,0,14,17,1,14,16,17,14,0,0],
|
||||||
|
"š":[0,0,10,4,0,30,1,14,16,15,0,0],
|
||||||
|
"Ţ":[0,0,0,31,4,4,4,4,4,4,4,3],
|
||||||
|
"ţ":[0,0,0,2,2,15,2,2,2,28,8,6],
|
||||||
|
"Ť":[10,4,0,31,4,4,4,4,4,4,0,0],
|
||||||
|
"ť":[0,0,8,10,2,15,2,2,2,28,0,0],
|
||||||
|
"Ŧ":[0,0,0,31,4,14,4,4,4,4,0,0],
|
||||||
|
"ŧ":[0,0,0,2,15,2,15,2,2,28,0,0],
|
||||||
|
"Ũ":[22,9,0,17,17,17,17,17,17,14,0,0],
|
||||||
|
"ũ":[0,0,22,9,0,17,17,17,17,30,0,0],
|
||||||
|
"Ū":[0,14,0,17,17,17,17,17,17,14,0,0],
|
||||||
|
"ū":[0,0,0,14,0,17,17,17,17,30,0,0],
|
||||||
|
"Ŭ":[10,4,0,17,17,17,17,17,17,14,0,0],
|
||||||
|
"ŭ":[0,0,10,4,0,17,17,17,17,30,0,0],
|
||||||
|
"Ů":[10,4,0,17,17,17,17,17,17,14,0,0],
|
||||||
|
"ů":[0,4,10,4,0,17,17,17,17,30,0,0],
|
||||||
|
"Ű":[20,10,0,17,17,17,17,17,17,14,0,0],
|
||||||
|
"ű":[0,0,20,10,0,17,17,17,17,30,0,0],
|
||||||
|
"Ų":[0,0,0,17,17,17,17,17,17,14,4,24],
|
||||||
|
"ų":[0,0,0,0,0,17,17,17,17,30,4,24],
|
||||||
|
"Ŵ":[4,10,0,17,17,17,17,21,27,17,0,0],
|
||||||
|
"ŵ":[0,0,4,10,0,17,17,21,21,10,0,0],
|
||||||
|
"Ŷ":[4,10,0,17,17,10,4,4,4,4,0,0],
|
||||||
|
"ŷ":[0,0,4,10,0,17,17,17,17,30,16,14],
|
||||||
|
"Ÿ":[0,10,0,17,17,10,4,4,4,4,0,0],
|
||||||
|
"Ź":[8,4,0,31,16,8,4,2,1,31,0,0],
|
||||||
|
"ź":[0,0,8,4,0,31,8,4,2,31,0,0],
|
||||||
|
"Ż":[0,4,0,31,16,8,4,2,1,31,0,0],
|
||||||
|
"ż":[0,0,0,4,0,31,8,4,2,31,0,0],
|
||||||
|
"Ž":[10,4,0,31,16,8,4,2,1,31,0,0],
|
||||||
|
"ž":[0,0,10,4,0,31,8,4,2,31,0,0],
|
||||||
|
"Ё":[0,10,0,31,1,1,15,1,1,31,0,0],
|
||||||
|
"А":[0,0,0,14,17,17,17,31,17,17,0,0],
|
||||||
|
"Б":[0,0,0,31,1,1,15,17,17,15,0,0],
|
||||||
|
"В":[0,0,0,15,17,17,15,17,17,15,0,0],
|
||||||
|
"Г":[0,0,0,31,1,1,1,1,1,1,0,0],
|
||||||
|
"Д":[0,0,0,12,10,10,10,10,10,31,17,0],
|
||||||
|
"Е":[0,0,0,31,1,1,15,1,1,31,0,0],
|
||||||
|
"Ж":[0,0,0,21,21,21,14,21,21,21,0,0],
|
||||||
|
"З":[0,0,0,14,17,16,14,16,17,14,0,0],
|
||||||
|
"И":[0,0,0,17,17,25,21,19,17,17,0,0],
|
||||||
|
"Й":[0,10,4,17,17,25,21,19,17,17,0,0],
|
||||||
|
"К":[0,0,0,25,5,5,3,5,9,17,0,0],
|
||||||
|
"Л":[0,0,0,30,18,18,18,18,18,17,0,0],
|
||||||
|
"М":[0,0,0,17,27,21,17,17,17,17,0,0],
|
||||||
|
"Н":[0,0,0,17,17,17,31,17,17,17,0,0],
|
||||||
|
"О":[0,0,0,14,17,17,17,17,17,14,0,0],
|
||||||
|
"П":[0,0,0,31,17,17,17,17,17,17,0,0],
|
||||||
|
"Р":[0,0,0,15,17,17,15,1,1,1,0,0],
|
||||||
|
"С":[0,0,0,14,17,1,1,1,17,14,0,0],
|
||||||
|
"Т":[0,0,0,31,4,4,4,4,4,4,0,0],
|
||||||
|
"У":[0,0,0,17,17,17,17,30,16,14,0,0],
|
||||||
|
"Ф":[0,0,0,4,14,21,21,21,14,4,0,0],
|
||||||
|
"Х":[0,0,0,17,17,10,4,10,17,17,0,0],
|
||||||
|
"Ц":[0,0,0,0,9,9,9,9,9,31,16,0],
|
||||||
|
"Ч":[0,0,0,17,17,17,30,16,16,16,0,0],
|
||||||
|
"Ш":[0,0,0,21,21,21,21,21,21,31,0,0],
|
||||||
|
"Щ":[0,0,0,21,21,21,21,21,21,31,16,0],
|
||||||
|
"Ъ":[0,0,0,0,3,2,14,18,18,14,0,0],
|
||||||
|
"Ы":[0,0,0,0,17,17,19,21,21,19,0,0],
|
||||||
|
"Ь":[0,0,0,0,1,1,15,17,17,15,0,0],
|
||||||
|
"Э":[0,0,0,14,17,16,28,16,17,14,0,0],
|
||||||
|
"Ю":[0,0,0,9,21,21,23,21,21,9,0,0],
|
||||||
|
"Я":[0,0,0,0,30,17,17,30,17,17,0,0],
|
||||||
|
"а":[0,0,0,0,0,14,16,30,17,30,0,0],
|
||||||
|
"б":[0,0,0,30,1,13,19,17,17,14,0,0],
|
||||||
|
"в":[0,0,0,0,0,15,17,15,17,15,0,0],
|
||||||
|
"г":[0,0,0,0,0,31,1,1,1,1,0,0],
|
||||||
|
"д":[0,0,0,0,0,12,10,10,10,31,17,0],
|
||||||
|
"е":[0,0,0,0,0,14,17,31,1,14,0,0],
|
||||||
|
"ж":[0,0,0,0,0,21,14,4,14,21,0,0],
|
||||||
|
"з":[0,0,0,0,0,6,9,4,9,6,0,0],
|
||||||
|
"и":[0,0,0,0,0,17,25,21,19,17,0,0],
|
||||||
|
"й":[0,0,0,10,4,17,25,21,19,17,0,0],
|
||||||
|
"к":[0,0,0,0,0,17,9,7,9,17,0,0],
|
||||||
|
"л":[0,0,0,0,0,30,18,18,18,17,0,0],
|
||||||
|
"м":[0,0,0,0,0,17,27,21,17,17,0,0],
|
||||||
|
"н":[0,0,0,0,0,17,17,31,17,17,0,0],
|
||||||
|
"о":[0,0,0,0,0,14,17,17,17,14,0,0],
|
||||||
|
"п":[0,0,0,0,0,31,17,17,17,17,0,0],
|
||||||
|
"р":[0,0,0,0,0,13,19,17,17,15,1,1],
|
||||||
|
"с":[0,0,0,0,0,14,17,1,17,14,0,0],
|
||||||
|
"т":[0,0,0,0,0,31,4,4,4,4,0,0],
|
||||||
|
"у":[0,0,0,0,0,17,17,17,17,30,16,14],
|
||||||
|
"ф":[0,0,0,4,4,14,21,21,21,14,4,4],
|
||||||
|
"х":[0,0,0,0,0,17,10,4,10,17,0,0],
|
||||||
|
"ц":[0,0,0,0,0,9,9,9,9,31,16,0],
|
||||||
|
"ч":[0,0,0,0,0,17,17,17,30,16,0,0],
|
||||||
|
"ш":[0,0,0,0,0,21,21,21,21,31,0,0],
|
||||||
|
"щ":[0,0,0,0,0,21,21,21,21,31,16,0],
|
||||||
|
"ъ":[0,0,0,0,0,3,2,14,18,14,0,0],
|
||||||
|
"ы":[0,0,0,0,0,17,17,19,21,19,0,0],
|
||||||
|
"ь":[0,0,0,0,0,1,1,15,17,15,0,0],
|
||||||
|
"э":[0,0,0,0,0,14,17,28,17,14,0,0],
|
||||||
|
"ю":[0,0,0,0,0,9,21,23,21,9,0,0],
|
||||||
|
"я":[0,0,0,0,0,30,17,17,30,17,0,0],
|
||||||
|
"ё":[0,0,0,10,0,14,17,31,1,14,0,0],
|
||||||
|
"—":[0,0,0,0,0,0,31,0,0,0,0,0],
|
||||||
|
"’":[0,0,0,8,4,0,0,0,0,0,0,0],
|
||||||
|
"…":[0,0,0,0,0,0,0,0,21,21,0,0],
|
||||||
|
"€":[0,0,0,12,18,7,2,7,18,12,0,0],
|
||||||
|
"←":[0,0,0,0,0,4,30,31,30,4,0,0],
|
||||||
|
"↑":[0,0,0,0,0,4,14,31,14,14,0,0],
|
||||||
|
"→":[0,0,0,0,0,4,15,31,15,4,0,0],
|
||||||
|
"↓":[0,0,0,0,0,14,14,31,14,4,0,0],
|
||||||
|
" ":[0,0,0,0,0,0,0,0,0,0,0,0]
|
||||||
|
}
|
BIN
assets/fonts/monogram/bitmap/monogram-bitmap.png
Normal file
BIN
assets/fonts/monogram/bitmap/monogram-bitmap.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/fonts/monogram/bitmap/monogram-italic-bitmap.png
Normal file
BIN
assets/fonts/monogram/bitmap/monogram-italic-bitmap.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
15
assets/fonts/monogram/credits.txt
Normal file
15
assets/fonts/monogram/credits.txt
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# CREDITS
|
||||||
|
|
||||||
|
Monogram is a free and Creative Commons Zero pixel font,
|
||||||
|
made by Vinícius Menézio (@vmenezio).
|
||||||
|
|
||||||
|
https://datagoblin.itch.io/monogram
|
||||||
|
|
||||||
|
|
||||||
|
# SPECIAL THANKS
|
||||||
|
|
||||||
|
thanks to Ateş Göral (@atesgoral) for creating the bitmap font converter:
|
||||||
|
https://codepen.io/atesgoral/details/RwGOvPZ
|
||||||
|
|
||||||
|
thanks to Éric Araujo (@merwok_) for the inital port of monogram to PICO-8:
|
||||||
|
https://itch.io/post/2625522
|
184
assets/fonts/monogram/pico-8/monogram.p8
Normal file
184
assets/fonts/monogram/pico-8/monogram.p8
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
pico-8 cartridge // http://www.pico-8.com
|
||||||
|
version 41
|
||||||
|
__lua__
|
||||||
|
-- monogram - A FREE FONT
|
||||||
|
-- BY vinicius menezio
|
||||||
|
-- datagoblin.itch.io/monogram
|
||||||
|
--
|
||||||
|
-- (COPY SNIPPET IN TAB 1)
|
||||||
|
--
|
||||||
|
-- SPECIAL THANKS TO merwok FOR
|
||||||
|
-- THE INITIAL PORT TO pico-8!
|
||||||
|
|
||||||
|
function _init()
|
||||||
|
cls()
|
||||||
|
rect(2,2,125,125,1)
|
||||||
|
spr(1,56,56,2,2)
|
||||||
|
|
||||||
|
-- load the font...
|
||||||
|
load_monogram()
|
||||||
|
-- ... then print whatever!
|
||||||
|
print("MONOGRAM\fc.P8",32,24,8)
|
||||||
|
print("A FREE FONT!",30,96,6)
|
||||||
|
end
|
||||||
|
|
||||||
|
function _update() end
|
||||||
|
-->8
|
||||||
|
-- load_monogram
|
||||||
|
|
||||||
|
-- COPY SNIPPET BELOW
|
||||||
|
-- INTO YOUR OWN CART:
|
||||||
|
|
||||||
|
function load_monogram()
|
||||||
|
-- enable custom fonts
|
||||||
|
poke(0x5f58,0x81)
|
||||||
|
|
||||||
|
-- add font to memory
|
||||||
|
poke(0x5600,unpack(split"6,6,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,31,31,31,31,31,31,0,0,0,31,31,31,0,0,0,0,0,31,27,31,0,0,0,0,0,27,4,27,0,0,0,0,0,27,0,27,0,0,0,0,0,27,27,27,0,0,0,0,8,12,14,12,8,0,0,0,2,6,14,6,2,0,0,15,1,1,1,1,0,0,0,0,0,16,16,16,16,30,0,17,10,4,31,4,31,4,0,0,0,0,14,0,0,0,0,0,0,0,0,0,6,12,0,0,0,0,0,0,12,12,0,0,0,10,10,0,0,0,0,0,4,10,4,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,0,4,0,10,10,0,0,0,0,0,0,0,10,31,10,10,31,10,0,8,62,11,62,104,62,8,0,0,51,24,12,6,51,0,0,6,9,9,30,9,9,22,0,8,4,0,0,0,0,0,0,8,4,4,4,4,4,8,0,2,4,4,4,4,4,2,0,0,4,21,14,21,4,0,0,0,4,4,31,4,4,0,0,0,0,0,0,0,4,4,2,0,0,0,31,0,0,0,0,0,0,0,0,0,4,4,0,16,16,8,4,2,1,1,0,14,17,25,21,19,17,14,0,4,6,4,4,4,4,31,0,14,17,16,8,4,2,31,0,14,17,16,12,16,17,14,0,18,18,17,31,16,16,16,0,31,1,1,15,16,16,15,0,14,1,1,15,17,17,14,0,31,16,16,8,4,4,4,0,14,17,17,14,17,17,14,0,14,17,17,30,16,16,14,0,0,4,4,0,0,4,4,0,0,4,4,0,0,4,4,2,0,24,6,1,6,24,0,0,0,0,31,0,31,0,0,0,0,3,12,16,12,3,0,0,14,17,16,8,4,0,4,0,14,25,21,21,25,1,14,0,0,0,30,17,17,17,30,0,1,1,15,17,17,17,15,0,0,0,14,17,1,17,14,0,16,16,30,17,17,17,30,0,0,0,14,17,31,1,14,0,12,18,2,15,2,2,2,0,0,0,30,17,17,30,16,14,1,1,15,17,17,17,17,0,4,0,6,4,4,4,31,0,16,0,24,16,16,16,17,14,1,1,17,9,7,9,17,0,3,2,2,2,2,2,28,0,0,0,15,21,21,21,21,0,0,0,15,17,17,17,17,0,0,0,14,17,17,17,14,0,0,0,15,17,17,15,1,1,0,0,30,17,17,30,16,16,0,0,13,19,1,1,1,0,0,0,30,1,14,16,15,0,2,2,15,2,2,2,28,0,0,0,17,17,17,17,30,0,0,0,17,17,17,10,4,0,0,0,17,17,21,21,10,0,0,0,17,10,4,10,17,0,0,0,17,17,17,30,16,14,0,0,31,8,4,2,31,0,12,4,4,4,4,4,12,0,1,1,2,4,8,16,16,0,12,8,8,8,8,8,12,0,4,10,17,0,0,0,0,0,0,0,0,0,0,0,31,0,2,4,0,0,0,0,0,0,14,17,17,17,31,17,17,0,15,17,17,15,17,17,15,0,14,17,1,1,1,17,14,0,15,17,17,17,17,17,15,0,31,1,1,15,1,1,31,0,31,1,1,15,1,1,1,0,14,17,1,29,17,17,14,0,17,17,17,31,17,17,17,0,31,4,4,4,4,4,31,0,16,16,16,16,17,17,14,0,17,9,5,3,5,9,17,0,1,1,1,1,1,1,31,0,17,27,21,17,17,17,17,0,17,17,19,21,25,17,17,0,14,17,17,17,17,17,14,0,15,17,17,15,1,1,1,0,14,17,17,17,21,9,22,0,15,17,17,15,17,17,17,0,14,17,1,14,16,17,14,0,31,4,4,4,4,4,4,0,17,17,17,17,17,17,14,0,17,17,17,17,17,10,4,0,17,17,17,17,21,27,17,0,17,17,10,4,10,17,17,0,17,17,10,4,4,4,4,0,31,16,8,4,2,1,31,0,8,4,4,2,4,4,8,0,4,4,4,0,4,4,4,0,4,8,8,16,8,8,4,0,0,0,18,13,0,0,0,0,0,0,0,0,0,0,0,0,31,31,31,31,31,31,31,0,21,10,21,10,21,10,21,0,0,17,31,21,21,14,0,0,14,31,17,27,14,17,14,0,17,4,17,4,17,4,17,0,2,6,30,14,15,12,8,0,0,14,19,19,31,23,14,0,0,27,31,31,14,4,0,0,4,17,14,27,27,14,17,4,0,14,14,0,31,14,10,0,0,4,14,31,21,29,0,0,14,27,25,27,14,17,14,0,0,14,31,21,31,17,14,0,4,12,20,20,4,7,3,0,14,17,21,17,14,17,14,0,0,4,14,27,14,4,0,0,0,0,0,21,0,0,0,0,14,27,19,27,14,17,14,0,0,0,4,31,14,27,0,0,31,17,10,4,10,17,31,0,14,27,17,31,14,17,14,0,0,5,2,0,20,8,0,0,8,21,2,0,8,21,2,0,14,21,27,21,14,17,14,0,31,0,31,0,31,0,31,0,21,21,21,21,21,21,21,0"))
|
||||||
|
end
|
||||||
|
__gfx__
|
||||||
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000002882000028820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00700700088888800888888000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00077000288888888888888200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00077000888888888888888800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00700700888888888888888800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000888888888888888800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000288888888888888200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000088888888888888000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000008888888888880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000000888888888800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000000088888888000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000000008888880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000000000888800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000000000088000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
__label__
|
||||||
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ccc00000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000c0000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000888800088800888800088800088880808800088880888800000000cccc00c000c0000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000808080800080800080800080800080880080800080808080000000c000c00ccc00000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000808080800080800080800080800080800000800080808080000000c000c0c000c0000000000000000000000000000100
|
||||||
|
0010000000000000000000000000000080808080008080008080008008888080000080008080808000c000cccc00c000c0000000000000000000000000000100
|
||||||
|
0010000000000000000000000000000080808008880080008008880000008080000008888080808000c000c000000ccc00000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000088800000000000000000000000000c00000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000002882000028820000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000088888800888888000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000288888888888888200000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000888888888888888800000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000888888888888888800000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000888888888888888800000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000288888888888888200000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000088888888888888000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000008888888888880000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000888888888800000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000088888888000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000008888880000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000888800000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000088000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000660000000000000000000000000000660000000000000006000000600000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000006006000000000000000000000000006006000000000000006000000600000000000000000000000000100
|
||||||
|
00100000000000000000000000000006666000000006000060660006660006660000000006000006660066660066660000600000000000000000000000000100
|
||||||
|
00100000000000000000000000000060006000000066660066006060006060006000000066660060006060006006000000600000000000000000000000000100
|
||||||
|
00100000000000000000000000000060006000000006000060000066666066666000000006000060006060006006000000600000000000000000000000000100
|
||||||
|
00100000000000000000000000000060006000000006000060000060000060000000000006000060006060006006000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000006666000000006000060000006660006660000000006000006660060006000666000600000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
|
||||||
|
00111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100
|
||||||
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
|
BIN
assets/fonts/monogram/pico-8/monogram.p8.png
Normal file
BIN
assets/fonts/monogram/pico-8/monogram.p8.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
BIN
assets/fonts/monogram/ttf/monogram-extended-italic.ttf
Normal file
BIN
assets/fonts/monogram/ttf/monogram-extended-italic.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/monogram/ttf/monogram-extended.ttf
Normal file
BIN
assets/fonts/monogram/ttf/monogram-extended.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/monogram/ttf/monogram.ttf
Normal file
BIN
assets/fonts/monogram/ttf/monogram.ttf
Normal file
Binary file not shown.
BIN
assets/goblin.aseprite
Normal file
BIN
assets/goblin.aseprite
Normal file
Binary file not shown.
251
src/bin/fail_tetris.rs
Normal file
251
src/bin/fail_tetris.rs
Normal file
@ -0,0 +1,251 @@
|
|||||||
|
use bevy::window::PrimaryWindow;
|
||||||
|
use bevy::{prelude::*, window::WindowResolution};
|
||||||
|
use std::fmt::{self, Display, Formatter};
|
||||||
|
use std::ops::{Add, Sub};
|
||||||
|
|
||||||
|
use glite::debug_plugin;
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "debug", derive(bevy_inspector_egui::InspectorOptions))]
|
||||||
|
#[derive(Component, Debug, Default, Copy, Clone, Eq, PartialEq, Reflect)]
|
||||||
|
struct Position {
|
||||||
|
pub x: u32,
|
||||||
|
pub y: u32,
|
||||||
|
pub z: u32, // render order
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Component, Debug, Reflect)]
|
||||||
|
struct Size {
|
||||||
|
width: f32,
|
||||||
|
height: f32,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Size {
|
||||||
|
pub fn square(x: f32) -> Self {
|
||||||
|
Self {
|
||||||
|
width: x,
|
||||||
|
height: x,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn post_scale_tiles(
|
||||||
|
window: Single<&Window>,
|
||||||
|
matrix: Res<Matrix>,
|
||||||
|
mut q: Query<(&Size, &mut Transform), With<Tile>>,
|
||||||
|
) {
|
||||||
|
for (sprite_size, mut transform) in q.iter_mut() {
|
||||||
|
transform.scale = Vec3::new(
|
||||||
|
sprite_size.width / matrix.width as f32 * window.width(),
|
||||||
|
sprite_size.height / matrix.height as f32 * window.height(),
|
||||||
|
1.0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn post_translate_tiles(
|
||||||
|
window: Single<&Window>,
|
||||||
|
matrix: Res<Matrix>,
|
||||||
|
mut q: Query<(&Position, &mut Transform), With<Tile>>,
|
||||||
|
) {
|
||||||
|
// We subtract half the window width because our coordinate system starts at the bottom left, and
|
||||||
|
// Translation starts from the center. We then add half the size of a single tile, because we want
|
||||||
|
// our sprites bottom left corner to be at the bottom left of a tile, not the center.
|
||||||
|
fn convert(pos: f32, bound_window: f32, bound_game: f32) -> f32 {
|
||||||
|
let tile_size = bound_window / bound_game;
|
||||||
|
pos / bound_game * bound_window - (bound_window / 2.) + (tile_size / 2.)
|
||||||
|
}
|
||||||
|
|
||||||
|
for (pos, mut transform) in q.iter_mut() {
|
||||||
|
transform.translation = Vec3::new(
|
||||||
|
convert(pos.x as f32, window.width(), matrix.width as f32),
|
||||||
|
convert(pos.y as f32, window.height(), matrix.height as f32),
|
||||||
|
pos.z as f32,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn translate_tetrominos(
|
||||||
|
tetrominos: Query<(&Tetromino, &mut Children)>,
|
||||||
|
mut positions: Query<&mut Position, With<Tile>>,
|
||||||
|
) {
|
||||||
|
for (t, children) in tetrominos.iter() {
|
||||||
|
for child in children.iter() {
|
||||||
|
let mut p = positions.get_mut(*child).unwrap();
|
||||||
|
p.x += t.pos.x;
|
||||||
|
p.y += t.pos.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Component, Debug, Clone, Reflect)]
|
||||||
|
struct TetrominoKind([[u32; 2]; 4]);
|
||||||
|
|
||||||
|
const BRICK_I: TetrominoKind = TetrominoKind([[0, 0], [1, 0], [2, 0], [3, 0]]);
|
||||||
|
const BRICK_J: TetrominoKind = TetrominoKind([[0, 0], [1, 0], [2, 0], [2, 1]]);
|
||||||
|
const BRICK_L: TetrominoKind = TetrominoKind([[0, 0], [1, 0], [2, 0], [0, 1]]);
|
||||||
|
const BRICK_O: TetrominoKind = TetrominoKind([[0, 0], [1, 0], [0, 1], [1, 1]]);
|
||||||
|
const BRICK_S: TetrominoKind = TetrominoKind([[0, 0], [1, 0], [1, 1], [2, 1]]);
|
||||||
|
const BRICK_T: TetrominoKind = TetrominoKind([[0, 0], [1, 0], [2, 0], [1, 1]]);
|
||||||
|
const BRICK_Z: TetrominoKind = TetrominoKind([[0, 1], [1, 1], [1, 0], [2, 0]]);
|
||||||
|
|
||||||
|
enum RenderLayer {
|
||||||
|
Background = 0,
|
||||||
|
Brick = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Component, Debug)]
|
||||||
|
struct Tile;
|
||||||
|
|
||||||
|
#[derive(Bundle, Debug)]
|
||||||
|
struct TileBundle {
|
||||||
|
position: Position,
|
||||||
|
size: Size,
|
||||||
|
sprite: Sprite,
|
||||||
|
tile: Tile,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn spawn_tile(commands: &mut Commands, color: Color, size: f32, position: Position) -> Entity {
|
||||||
|
commands
|
||||||
|
.spawn(TileBundle {
|
||||||
|
position,
|
||||||
|
size: Size::square(size),
|
||||||
|
sprite: Sprite {
|
||||||
|
color,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
tile: Tile,
|
||||||
|
})
|
||||||
|
.id()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Component, Reflect)]
|
||||||
|
struct Tetromino {
|
||||||
|
pos: Position,
|
||||||
|
kind: TetrominoKind,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn spawn_tetromino(commands: &mut Commands, kind: TetrominoKind, x: u32, y: u32) {
|
||||||
|
let tetromino = commands
|
||||||
|
.spawn(Tetromino {
|
||||||
|
pos: Position { x, y, z: 0 },
|
||||||
|
kind: kind.clone(),
|
||||||
|
})
|
||||||
|
.insert((Transform::default(), Visibility::default()))
|
||||||
|
.id();
|
||||||
|
|
||||||
|
for coord in kind.0 {
|
||||||
|
let e = spawn_tile(
|
||||||
|
commands,
|
||||||
|
Color::srgb(0.3, 0.3, 0.8),
|
||||||
|
0.9,
|
||||||
|
Position {
|
||||||
|
x: x + coord[0],
|
||||||
|
y: y + coord[1],
|
||||||
|
z: RenderLayer::Brick as u32,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
commands.entity(e).set_parent(tetromino);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let mut app = App::new();
|
||||||
|
app.add_plugins(DefaultPlugins.set(WindowPlugin {
|
||||||
|
primary_window: Some(Window {
|
||||||
|
title: "Tetris".to_string(),
|
||||||
|
..default()
|
||||||
|
}),
|
||||||
|
..default()
|
||||||
|
}));
|
||||||
|
|
||||||
|
app.add_systems(
|
||||||
|
Startup,
|
||||||
|
(init_singletons, init_window, init_tile_grid).chain(),
|
||||||
|
)
|
||||||
|
.add_systems(
|
||||||
|
PostUpdate,
|
||||||
|
(translate_tetrominos, post_scale_tiles, post_translate_tiles).chain(),
|
||||||
|
);
|
||||||
|
|
||||||
|
app.add_plugins(debug_plugin::debug_plugin);
|
||||||
|
|
||||||
|
app.register_type::<Position>();
|
||||||
|
app.register_type::<Tetromino>();
|
||||||
|
app.register_type::<Size>();
|
||||||
|
|
||||||
|
// Run the app
|
||||||
|
app.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Resource)]
|
||||||
|
struct Score(u32);
|
||||||
|
|
||||||
|
#[derive(Resource, Copy, Clone)]
|
||||||
|
struct Matrix {
|
||||||
|
width: u32,
|
||||||
|
height: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn init_singletons(mut commands: Commands) {
|
||||||
|
let matrix = Matrix {
|
||||||
|
height: 15,
|
||||||
|
width: 15,
|
||||||
|
};
|
||||||
|
commands.insert_resource(Score(0));
|
||||||
|
commands.insert_resource(matrix);
|
||||||
|
|
||||||
|
commands.spawn(Camera2d {});
|
||||||
|
}
|
||||||
|
|
||||||
|
fn init_window(matrix: Res<Matrix>, mut window: Single<&mut Window>) {
|
||||||
|
const SCALE_FACTOR: f32 = 77.;
|
||||||
|
|
||||||
|
window.resolution.set(
|
||||||
|
matrix.width as f32 * SCALE_FACTOR,
|
||||||
|
matrix.height as f32 * SCALE_FACTOR,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Component)]
|
||||||
|
struct Grid;
|
||||||
|
|
||||||
|
fn init_tile_grid(mut commands: Commands, matrix: Res<Matrix>) {
|
||||||
|
let grid = commands
|
||||||
|
.spawn(Grid)
|
||||||
|
.insert(Name::new("Background Grid"))
|
||||||
|
.insert((Transform::default(), Visibility::default()))
|
||||||
|
.id();
|
||||||
|
|
||||||
|
for y in 0..matrix.height {
|
||||||
|
for x in 0..matrix.width {
|
||||||
|
let color = match (y + x) % 2 == 0 {
|
||||||
|
true => Color::srgb(0.5, 0.5, 0.5),
|
||||||
|
false => Color::srgb(0.55, 0.55, 0.55),
|
||||||
|
};
|
||||||
|
let e = spawn_tile(
|
||||||
|
&mut commands,
|
||||||
|
color,
|
||||||
|
1.0,
|
||||||
|
Position {
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
z: RenderLayer::Background as u32,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
commands.entity(e).set_parent(grid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
test_render_all_tetrominos(commands);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn test_render_all_tetrominos(mut commands: Commands) {
|
||||||
|
spawn_tetromino(&mut commands, BRICK_I, 0, 0);
|
||||||
|
spawn_tetromino(&mut commands, BRICK_T, 4, 0);
|
||||||
|
spawn_tetromino(&mut commands, BRICK_J, 8, 0);
|
||||||
|
spawn_tetromino(&mut commands, BRICK_L, 12, 0);
|
||||||
|
|
||||||
|
spawn_tetromino(&mut commands, BRICK_O, 0, 4);
|
||||||
|
spawn_tetromino(&mut commands, BRICK_S, 4, 4);
|
||||||
|
spawn_tetromino(&mut commands, BRICK_Z, 8, 4);
|
||||||
|
spawn_tetromino(&mut commands, BRICK_J, 12, 4);
|
||||||
|
}
|
77
src/bin/states.rs
Normal file
77
src/bin/states.rs
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
|
#[derive(States, Clone, Copy, Eq, PartialEq, Debug, Hash)]
|
||||||
|
enum AppState {
|
||||||
|
Splash,
|
||||||
|
Menu,
|
||||||
|
Game,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
App::new()
|
||||||
|
.add_plugins(DefaultPlugins)
|
||||||
|
.insert_state(AppState::Splash)
|
||||||
|
.add_systems(Startup, setup)
|
||||||
|
// define transitions :
|
||||||
|
.add_systems(OnEnter(AppState::Splash), setup_splash)
|
||||||
|
.add_systems(OnEnter(AppState::Menu), setup_menu)
|
||||||
|
.add_systems(Update, splash_screen.run_if(in_state(AppState::Splash)))
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Component)]
|
||||||
|
struct SplashScreenTimer(Timer);
|
||||||
|
|
||||||
|
#[derive(Component)]
|
||||||
|
struct GameFont(Handle<Font>);
|
||||||
|
|
||||||
|
fn splash_screen(
|
||||||
|
mut commands: Commands,
|
||||||
|
time: ResMut<Time>,
|
||||||
|
mut timer: Single<&mut SplashScreenTimer>,
|
||||||
|
text: Single<Entity, With<Text2d>>,
|
||||||
|
mut next_state: ResMut<NextState<AppState>>,
|
||||||
|
) {
|
||||||
|
if timer.0.tick(time.delta()).just_finished() {
|
||||||
|
commands.entity(text.into_inner()).despawn();
|
||||||
|
next_state.set(AppState::Menu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn setup_splash(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
|
let font = asset_server.load("fonts/monogram/ttf/monogram.ttf");
|
||||||
|
let text_font = TextFont {
|
||||||
|
font: font.clone(),
|
||||||
|
font_size: 50.0,
|
||||||
|
..default()
|
||||||
|
};
|
||||||
|
let text_justification = JustifyText::Center;
|
||||||
|
|
||||||
|
commands.spawn((
|
||||||
|
Text2d::new("Splash Screen lol"),
|
||||||
|
text_font,
|
||||||
|
TextLayout::new_with_justify(text_justification),
|
||||||
|
));
|
||||||
|
|
||||||
|
commands.spawn(SplashScreenTimer(Timer::from_seconds(2.0, TimerMode::Once)));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn setup_menu(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
|
let font = asset_server.load("fonts/monogram/ttf/monogram.ttf");
|
||||||
|
let text_font = TextFont {
|
||||||
|
font: font.clone(),
|
||||||
|
font_size: 50.0,
|
||||||
|
..default()
|
||||||
|
};
|
||||||
|
let text_justification = JustifyText::Center;
|
||||||
|
|
||||||
|
commands.spawn((
|
||||||
|
Text2d::new("Game Menu"),
|
||||||
|
text_font,
|
||||||
|
TextLayout::new_with_justify(text_justification),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn setup(mut commands: Commands) {
|
||||||
|
commands.spawn(Camera2d::default());
|
||||||
|
}
|
@ -1,224 +1,5 @@
|
|||||||
use bevy::window::PrimaryWindow;
|
use bevy::prelude::*;
|
||||||
use bevy::{prelude::*, window::WindowResolution};
|
|
||||||
use std::fmt::{self, Display, Formatter};
|
|
||||||
use std::ops::{Add, Sub};
|
|
||||||
|
|
||||||
use glite::debug_plugin;
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "debug", derive(bevy_inspector_egui::InspectorOptions))]
|
|
||||||
#[derive(Component, Debug, Default, Copy, Clone, Eq, PartialEq)]
|
|
||||||
struct Position {
|
|
||||||
pub x: u32,
|
|
||||||
pub y: u32,
|
|
||||||
pub z: u32, // render order
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Add for Position {
|
|
||||||
type Output = Self;
|
|
||||||
fn add(self, other: Self) -> Self {
|
|
||||||
Self {
|
|
||||||
x: self.x + other.x,
|
|
||||||
y: self.y + other.y,
|
|
||||||
z: self.z + other.z,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Sub for Position {
|
|
||||||
type Output = Self;
|
|
||||||
fn sub(self, other: Self) -> Self {
|
|
||||||
Self {
|
|
||||||
x: self.x.saturating_sub(other.x),
|
|
||||||
y: self.y.saturating_sub(other.y),
|
|
||||||
z: self.z.saturating_sub(other.z),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Component)]
|
|
||||||
struct Size {
|
|
||||||
width: f32,
|
|
||||||
height: f32,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Size {
|
|
||||||
pub fn square(x: f32) -> Self {
|
|
||||||
Self {
|
|
||||||
width: x,
|
|
||||||
height: x,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn spawn_tile(commands: &mut Commands, color: Color, size: f32, position: Position) -> Entity {
|
|
||||||
commands
|
|
||||||
.spawn(Sprite {
|
|
||||||
color,
|
|
||||||
..Default::default()
|
|
||||||
})
|
|
||||||
.insert(position)
|
|
||||||
.insert(Size::square(size))
|
|
||||||
.id()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn scale_translation(
|
|
||||||
window: Single<&Window>,
|
|
||||||
mut q: Query<(&Size, &mut Transform)>,
|
|
||||||
matrix: Res<Matrix>,
|
|
||||||
) {
|
|
||||||
for (sprite_size, mut transform) in q.iter_mut() {
|
|
||||||
transform.scale = Vec3::new(
|
|
||||||
sprite_size.width / matrix.width as f32 * window.width(),
|
|
||||||
sprite_size.height / matrix.height as f32 * window.height(),
|
|
||||||
1.0,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn position_translation(
|
|
||||||
window: Single<&Window>,
|
|
||||||
mut q: Query<(&Position, &mut Transform)>,
|
|
||||||
matrix: Res<Matrix>,
|
|
||||||
) {
|
|
||||||
// We subtract half the window width because our coordinate system starts at the bottom left, and
|
|
||||||
// Translation starts from the center. We then add half the size of a single tile, because we want
|
|
||||||
// our sprites bottom left corner to be at the bottom left of a tile, not the center.
|
|
||||||
fn convert(pos: f32, bound_window: f32, bound_game: f32) -> f32 {
|
|
||||||
let tile_size = bound_window / bound_game;
|
|
||||||
pos / bound_game * bound_window - (bound_window / 2.) + (tile_size / 2.)
|
|
||||||
}
|
|
||||||
|
|
||||||
for (pos, mut transform) in q.iter_mut() {
|
|
||||||
transform.translation = Vec3::new(
|
|
||||||
convert(pos.x as f32, window.width(), matrix.width as f32),
|
|
||||||
convert(pos.y as f32, window.height(), matrix.height as f32),
|
|
||||||
pos.z as f32,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Component)]
|
|
||||||
struct Tetromino([[u32; 2]; 4]);
|
|
||||||
|
|
||||||
// TODO: check these positions are right
|
|
||||||
const BRICK_I: Tetromino = Tetromino([[0, 0], [1, 0], [2, 0], [3, 0]]);
|
|
||||||
const BRICK_J: Tetromino = Tetromino([[0, 0], [1, 0], [2, 0], [2, 1]]);
|
|
||||||
const BRICK_L: Tetromino = Tetromino([[0, 0], [1, 0], [2, 0], [0, 1]]);
|
|
||||||
const BRICK_O: Tetromino = Tetromino([[0, 0], [1, 0], [0, 1], [1, 1]]);
|
|
||||||
const BRICK_S: Tetromino = Tetromino([[0, 0], [1, 0], [1, 1], [2, 1]]);
|
|
||||||
const BRICK_T: Tetromino = Tetromino([[0, 0], [1, 0], [2, 0], [1, 1]]);
|
|
||||||
const BRICK_Z: Tetromino = Tetromino([[0, 1], [1, 1], [1, 0], [2, 0]]);
|
|
||||||
|
|
||||||
enum RenderLayer {
|
|
||||||
Background = 0,
|
|
||||||
Brick = 10,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn spawn_tetromino(commands: &mut Commands, tetromino: Tetromino, x: u32, y: u32) {
|
|
||||||
for coord in tetromino.0 {
|
|
||||||
spawn_tile(
|
|
||||||
commands,
|
|
||||||
Color::srgb(1.0, 1.0, 1.0),
|
|
||||||
0.77,
|
|
||||||
Position {
|
|
||||||
x: coord[0] + x,
|
|
||||||
y: coord[1] + y,
|
|
||||||
z: RenderLayer::Brick as u32,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut app = App::new();
|
App::new().add_plugins(DefaultPlugins).run();
|
||||||
app.add_plugins(DefaultPlugins.set(WindowPlugin {
|
|
||||||
primary_window: Some(Window {
|
|
||||||
title: "Tetris".to_string(),
|
|
||||||
..default()
|
|
||||||
}),
|
|
||||||
..default()
|
|
||||||
}));
|
|
||||||
|
|
||||||
app.add_systems(
|
|
||||||
Startup,
|
|
||||||
(init_singletons, init_window, init_tile_grid).chain(),
|
|
||||||
)
|
|
||||||
.add_systems(PostUpdate, (scale_translation, position_translation));
|
|
||||||
|
|
||||||
app.add_plugins(debug_plugin::debug_plugin);
|
|
||||||
|
|
||||||
// Run the app
|
|
||||||
app.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Resource)]
|
|
||||||
struct Score(u32);
|
|
||||||
|
|
||||||
#[derive(Resource, Copy, Clone)]
|
|
||||||
struct Matrix {
|
|
||||||
width: u32,
|
|
||||||
height: u32,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn init_singletons(mut commands: Commands) {
|
|
||||||
let matrix = Matrix {
|
|
||||||
height: 15,
|
|
||||||
width: 15,
|
|
||||||
};
|
|
||||||
commands.insert_resource(Score(0));
|
|
||||||
commands.insert_resource(matrix);
|
|
||||||
|
|
||||||
commands.spawn(Camera2d {});
|
|
||||||
}
|
|
||||||
|
|
||||||
fn init_window(matrix: Res<Matrix>, mut window: Single<&mut Window>) {
|
|
||||||
const SCALE_FACTOR: f32 = 77.;
|
|
||||||
|
|
||||||
window.resolution.set(
|
|
||||||
matrix.width as f32 * SCALE_FACTOR,
|
|
||||||
matrix.height as f32 * SCALE_FACTOR,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Component)]
|
|
||||||
struct Grid;
|
|
||||||
|
|
||||||
fn init_tile_grid(mut commands: Commands, matrix: Res<Matrix>) {
|
|
||||||
let grid = commands
|
|
||||||
.spawn(Grid)
|
|
||||||
.insert(Name::new("Background Grid"))
|
|
||||||
.insert((Transform::default(), Visibility::default()))
|
|
||||||
.id();
|
|
||||||
|
|
||||||
for y in 0..matrix.height {
|
|
||||||
for x in 0..matrix.width {
|
|
||||||
let color = match (y + x) % 2 == 0 {
|
|
||||||
true => Color::srgb(0.5, 0.5, 0.5),
|
|
||||||
false => Color::srgb(0.55, 0.55, 0.55),
|
|
||||||
};
|
|
||||||
let e = spawn_tile(
|
|
||||||
&mut commands,
|
|
||||||
color,
|
|
||||||
1.0,
|
|
||||||
Position {
|
|
||||||
x,
|
|
||||||
y,
|
|
||||||
z: RenderLayer::Background as u32,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
commands.entity(e).set_parent(grid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
test_render_all_tetrominos(commands);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn test_render_all_tetrominos(mut commands: Commands) {
|
|
||||||
spawn_tetromino(&mut commands, BRICK_I, 0, 0);
|
|
||||||
spawn_tetromino(&mut commands, BRICK_T, 4, 0);
|
|
||||||
spawn_tetromino(&mut commands, BRICK_J, 8, 0);
|
|
||||||
spawn_tetromino(&mut commands, BRICK_L, 12, 0);
|
|
||||||
spawn_tetromino(&mut commands, BRICK_O, 0, 4);
|
|
||||||
spawn_tetromino(&mut commands, BRICK_S, 4, 4);
|
|
||||||
spawn_tetromino(&mut commands, BRICK_Z, 8, 4);
|
|
||||||
spawn_tetromino(&mut commands, BRICK_J, 12, 4);
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user