feat: comic sans move number (also fix *)

fix: the limits of an asset can exceed the image dimensions
This commit is contained in:
mcolonna 2024-04-18 21:04:55 +02:00
parent d179734202
commit bc9cee22d7
33 changed files with 1954 additions and 51 deletions

View file

@ -7,7 +7,7 @@ CODE = $(addprefix main/, \
) \
$(addprefix display/, \
data_assets data_sprites \
display1 display2 display_utils sprite \
display1 display2 display_utils sprite text \
) \
$(addprefix room/, \
visual room1 room2 room3 room_utils1 room_utils2 camera \

View file

@ -0,0 +1,163 @@
/* XPM */
static char *__alpha[] = {
/* columns rows colors chars-per-pixel */
"19 26 131 2 ",
" c black",
". c #010101",
"X c #020202",
"o c gray1",
"O c #040404",
"+ c #070707",
"@ c gray3",
"# c #090909",
"$ c gray4",
"% c #0B0B0B",
"& c #0C0C0C",
"* c gray5",
"= c #0E0E0E",
"- c #101010",
"; c gray7",
": c #151515",
"> c #161616",
", c gray9",
"< c #181818",
"1 c #191919",
"2 c gray10",
"3 c gray11",
"4 c #1E1E1E",
"5 c #202020",
"6 c gray13",
"7 c #222222",
"8 c #232323",
"9 c gray14",
"0 c #252525",
"q c gray15",
"w c #272727",
"e c gray16",
"r c gray19",
"t c #313131",
"y c gray20",
"u c #373737",
"i c #393939",
"p c gray23",
"a c gray24",
"s c #3E3E3E",
"d c #3F3F3F",
"f c gray25",
"g c #434343",
"h c #484848",
"j c #494949",
"k c #4C4C4C",
"l c gray32",
"z c gray34",
"x c #585858",
"c c gray36",
"v c #606060",
"b c gray38",
"n c gray39",
"m c gray40",
"M c gray43",
"N c #6F6F6F",
"B c gray45",
"V c #747474",
"C c gray46",
"Z c gray51",
"A c #838383",
"S c #848484",
"D c #888888",
"F c gray54",
"G c gray55",
"H c gray57",
"J c #959595",
"K c gray59",
"L c #989898",
"P c #9A9A9A",
"I c #9D9D9D",
"U c gray62",
"Y c #A0A0A0",
"T c #A2A2A2",
"R c #A4A4A4",
"E c #A7A7A7",
"W c gray70",
"Q c #B4B4B4",
"! c #B6B6B6",
"~ c gray",
"^ c #C0C0C0",
"/ c #C1C1C1",
"( c gray76",
") c #C3C3C3",
"_ c gray77",
"` c #C5C5C5",
"' c gray78",
"] c gray79",
"[ c #CACACA",
"{ c #CBCBCB",
"} c #D0D0D0",
"| c gray82",
" . c #D2D2D2",
".. c LightGray",
"X. c gray83",
"o. c #D8D8D8",
"O. c gray85",
"+. c #DADADA",
"@. c gray86",
"#. c gainsboro",
"$. c #DDDDDD",
"%. c gray87",
"&. c #DFDFDF",
"*. c gray88",
"=. c #E1E1E1",
"-. c #E2E2E2",
";. c gray89",
":. c #E4E4E4",
">. c gray90",
",. c #E6E6E6",
"<. c #E7E7E7",
"1. c #E9E9E9",
"2. c gray92",
"3. c #ECECEC",
"4. c gray93",
"5. c #EEEEEE",
"6. c #EFEFEF",
"7. c gray94",
"8. c #F1F1F1",
"9. c gray95",
"0. c #F3F3F3",
"q. c #F4F4F4",
"w. c gray96",
"e. c gray97",
"r. c #F9F9F9",
"t. c gray98",
"y. c #FBFBFB",
"u. c gray99",
"i. c #FDFDFD",
"p. c #FEFEFE",
"a. c white",
/* pixels */
" ; 3 2 * ",
" $ j P [ #.@.^ F t ",
" 3 I q.a.a.a.a.a.a.>.B + ",
" 2 Q a.a.a.6.X.@.0.a.a.q.B ",
" + K a.a.6.F t 2 2 s T y.a.6.g ",
" k 0.a.0.n $ K a.a.W $ ",
" $ W a.a.G + 8 X.a.0.g ",
" u 6.a.@.8 H a.a.S ",
" B a.a.K x a.a.Q $ ",
" T a.y.x u 6.a.X.2 ",
"* ^ a.0.u q >.a.#.q ",
", .a.>.q 8 -.a.-.e ",
"2 .a.-.8 8 #.a.-.q ",
", .a.1.q q >.a.#.8 ",
"; [ a.6.t t 6.a. ., ",
"+ Q a.q.g h y.a.~ $ ",
" P a.a.n M a.a.T ",
" M a.a.K + E a.a.V ",
" i 0.a. ., q -.a.q.g ",
" ; _ a.y.m S a.a.[ ; ",
" M a.a.@.i l 1.a.a.V ",
" , ^ a.a.@.M t 8 u Z 1.a.a._ 2 ",
" s #.a.a.a.6.-.6.a.a.a.-.s ",
" g ^ a.a.a.a.a.a.a.^ s ",
" 2 c T ^ { ^ I c , ",
" + * ; $ + "
};

33
assets/text/little/0.xpm Normal file
View file

@ -0,0 +1,33 @@
/* XPM */
static char *_[] = {
/* columns rows colors chars-per-pixel */
"19 26 1 1 ",
" c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

View file

@ -0,0 +1,127 @@
/* XPM */
static char *__alpha[] = {
/* columns rows colors chars-per-pixel */
"12 26 95 2 ",
" c black",
". c #010101",
"X c #020202",
"o c gray1",
"O c gray2",
"+ c #060606",
"@ c gray3",
"# c #090909",
"$ c gray4",
"% c #0B0B0B",
"& c #0E0E0E",
"* c gray6",
"= c #101010",
"- c #111111",
"; c gray8",
": c #151515",
"> c #161616",
", c #181818",
"< c gray10",
"1 c #1B1B1B",
"2 c gray12",
"3 c gray14",
"4 c #252525",
"5 c #272727",
"6 c gray16",
"7 c #2A2A2A",
"8 c #323232",
"9 c gray20",
"0 c #393939",
"q c #3C3C3C",
"w c #3F3F3F",
"e c gray25",
"r c gray27",
"t c #464646",
"y c gray28",
"u c #494949",
"i c #4C4C4C",
"p c gray31",
"a c #515151",
"s c gray32",
"d c #535353",
"f c #555555",
"g c gray34",
"h c gray35",
"j c gray36",
"k c #676767",
"l c #686868",
"z c #6A6A6A",
"x c #6C6C6C",
"c c #6F6F6F",
"v c #747474",
"b c #818181",
"n c #898989",
"m c gray56",
"M c #959595",
"N c #9A9A9A",
"B c gray61",
"V c #A7A7A7",
"C c gray66",
"Z c #AAAAAA",
"A c gray70",
"S c gray71",
"D c #B9B9B9",
"F c gray73",
"G c gray74",
"H c #C1C1C1",
"J c #C3C3C3",
"K c #C6C6C6",
"L c gray78",
"P c #C8C8C8",
"I c #CBCBCB",
"U c #CECECE",
"Y c gray82",
"T c LightGray",
"R c gray84",
"E c #DADADA",
"W c gainsboro",
"Q c gray88",
"! c gray90",
"~ c #E7E7E7",
"^ c #E9E9E9",
"/ c #EAEAEA",
"( c gray92",
") c #EFEFEF",
"_ c #F3F3F3",
"` c gray96",
"' c #F6F6F6",
"] c #F8F8F8",
"[ c #F9F9F9",
"{ c gray98",
"} c #FBFBFB",
"| c gray99",
" . c #FDFDFD",
".. c #FEFEFE",
"X. c white",
/* pixels */
" % ; + ",
" u S U q ",
" + k / X.X.l ",
" ; n ' X.X.X.d ",
" 3 A X.X.X.X.' y ",
"# V X.X.X.] X.] i ",
"# S X./ b H X.X.f ",
" 7 v q + D X.X.h ",
" # H X.X.d ",
" = U X.] y ",
" 1 E X._ 0 ",
" 3 ! X./ 7 ",
" 9 _ X.E 1 ",
" q ' X.I = ",
" i X.X.D # ",
" j X.X.Z ",
" l X.X.B ",
" x X.X.M ",
" k X.X.N ",
" f X.X.Z + ",
" y ] X.D + ",
" ; 2 i ' X.U 9 3 # ",
"+ x Y Q ! X.X.] / ! m # ",
"; R X.X.X.X.X.X.X.X.R 1 ",
"+ v G K K I K I K K l + ",
" % % = = = = % = "
};

33
assets/text/little/1.xpm Normal file
View file

@ -0,0 +1,33 @@
/* XPM */
static char *_[] = {
/* columns rows colors chars-per-pixel */
"12 26 1 1 ",
" c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

View file

@ -0,0 +1,156 @@
/* XPM */
static char *__alpha[] = {
/* columns rows colors chars-per-pixel */
"17 26 124 2 ",
" c black",
". c #010101",
"X c #020202",
"o c gray1",
"O c #040404",
"+ c gray2",
"@ c #060606",
"# c #070707",
"$ c gray3",
"% c #090909",
"& c gray4",
"* c #0B0B0B",
"= c #0C0C0C",
"- c gray5",
"; c #0E0E0E",
": c gray6",
"> c gray8",
", c #161616",
"< c gray9",
"1 c #181818",
"2 c #191919",
"3 c #1D1D1D",
"4 c #202020",
"5 c gray13",
"6 c #222222",
"7 c #232323",
"8 c #272727",
"9 c #282828",
"0 c gray16",
"q c #2A2A2A",
"w c gray18",
"e c gray19",
"r c #353535",
"t c gray21",
"y c gray22",
"u c #393939",
"i c gray23",
"p c #3C3C3C",
"a c #3E3E3E",
"s c #464646",
"d c gray29",
"f c #4B4B4B",
"g c #505050",
"h c #535353",
"j c gray33",
"k c gray34",
"l c #585858",
"z c #5A5A5A",
"x c #5B5B5B",
"c c gray36",
"v c gray37",
"b c #5F5F5F",
"n c #606060",
"m c #656565",
"M c gray40",
"N c DimGray",
"B c gray42",
"V c #6D6D6D",
"C c gray45",
"Z c gray46",
"A c gray47",
"S c #7C7C7C",
"D c gray49",
"F c gray53",
"G c #888888",
"H c #898989",
"J c gray54",
"K c #8B8B8B",
"L c gray55",
"P c #8D8D8D",
"I c #929292",
"U c #959595",
"Y c gray59",
"T c #979797",
"R c #989898",
"E c gray60",
"W c gray61",
"Q c #9D9D9D",
"! c gray62",
"~ c #9F9F9F",
"^ c #A0A0A0",
"/ c gray63",
"( c #A2A2A2",
") c #A4A4A4",
"_ c #A5A5A5",
"` c #AEAEAE",
"' c gray69",
"] c #B4B4B4",
"[ c gray71",
"{ c #B6B6B6",
"} c #B7B7B7",
"| c #BCBCBC",
" . c #C0C0C0",
".. c gray76",
"X. c #C5C5C5",
"o. c #C8C8C8",
"O. c gray79",
"+. c #CACACA",
"@. c #CBCBCB",
"#. c gray81",
"$. c #D0D0D0",
"%. c gray82",
"&. c #D2D2D2",
"*. c LightGray",
"=. c gray83",
"-. c #D5D5D5",
";. c #D7D7D7",
":. c #DDDDDD",
">. c gray88",
",. c #E7E7E7",
"<. c gray91",
"1. c #E9E9E9",
"2. c gray92",
"3. c gray93",
"4. c #EEEEEE",
"5. c #EFEFEF",
"6. c #F1F1F1",
"7. c #F3F3F3",
"8. c gray96",
"9. c #F8F8F8",
"0. c gray98",
"q. c gray99",
"w. c #FDFDFD",
"e. c white",
/* pixels */
" : < < % ",
" @ a K ..=.&.| F y @ ",
" 5 U 5.e.e.e.e.e.e.<.K < ",
" a +.e.e.e.9.<.5.e.e.e.e.! : ",
" f >.e.e.7.! d q e V =.e.e.9.l ",
": ..e.e.:.c @ q #.e.e.! ",
"% U ,.{ r P e.e.` @ ",
" : 8 : ! e.e.^ ",
" 3 =.e.e.A ",
" @ K e.e.7.y ",
" : S 8.e.e.^ % ",
" q ^ 9.e.e.#.q ",
" @ l =.e.e.e.+.r ",
" 5 E 8.e.e.9.^ 5 ",
" s +.e.e.e.&.c : ",
" @ N <.e.e.7.I 5 ",
" l 7.e.e.=.j @ ",
" 3 &.e.e.X.q ",
" M e.e.,.a ",
"@ ^ e.e.U @ ",
": X.e.e.h ",
"< #.e.9.C j N S K U ! _ _ K h : ",
"> #.e.e.9.e.e.e.e.e.e.e.e.e.9.E % ",
"% ` e.e.e.e.e.e.e.e.e.e.e.e.e.&.1 ",
" y ! { { ! K S Z N n l c U { l @ ",
" @ % @ "
};

33
assets/text/little/2.xpm Normal file
View file

@ -0,0 +1,33 @@
/* XPM */
static char *_[] = {
/* columns rows colors chars-per-pixel */
"17 26 1 1 ",
" c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

View file

@ -0,0 +1,152 @@
/* XPM */
static char *__alpha[] = {
/* columns rows colors chars-per-pixel */
"16 26 120 2 ",
" c black",
". c #010101",
"X c #020202",
"o c gray1",
"O c #040404",
"+ c gray2",
"@ c #060606",
"# c #070707",
"$ c gray3",
"% c #090909",
"& c gray4",
"* c #0C0C0C",
"= c gray5",
"- c #101010",
"; c #111111",
": c gray7",
"> c gray8",
", c #151515",
"< c #161616",
"1 c gray9",
"2 c #181818",
"3 c #191919",
"4 c gray10",
"5 c #1B1B1B",
"6 c gray11",
"7 c #1E1E1E",
"8 c gray12",
"9 c gray13",
"0 c #232323",
"q c #272727",
"w c #282828",
"e c gray16",
"r c gray18",
"t c #313131",
"y c gray20",
"u c #343434",
"i c #353535",
"p c gray21",
"a c #373737",
"s c #393939",
"d c gray23",
"f c #3C3C3C",
"g c gray24",
"h c #3F3F3F",
"j c gray25",
"k c #494949",
"l c #4B4B4B",
"z c #4C4C4C",
"x c #4E4E4E",
"c c #505050",
"v c #515151",
"b c #535353",
"n c gray33",
"m c #555555",
"M c #5A5A5A",
"N c gray36",
"B c #676767",
"V c gray42",
"C c gray43",
"Z c gray44",
"A c #727272",
"S c #777777",
"D c #818181",
"F c gray51",
"G c #838383",
"H c #8E8E8E",
"J c gray56",
"K c gray57",
"L c #939393",
"P c #989898",
"I c gray60",
"U c gray61",
"Y c #9D9D9D",
"T c gray62",
"R c #A4A4A4",
"E c #A5A5A5",
"W c gray66",
"Q c #AEAEAE",
"! c gray71",
"~ c #B7B7B7",
"^ c #B9B9B9",
"/ c gray73",
"( c #BBBBBB",
") c #BCBCBC",
"_ c #C0C0C0",
"` c gray76",
"' c #C8C8C8",
"] c gray79",
"[ c #CBCBCB",
"{ c gray80",
"} c #CECECE",
"| c #D2D2D2",
" . c gray83",
".. c gray85",
"X. c gray86",
"o. c #DDDDDD",
"O. c gray87",
"+. c gray88",
"@. c gray89",
"#. c #E4E4E4",
"$. c #E7E7E7",
"%. c gray91",
"&. c gray92",
"*. c #EEEEEE",
"=. c #EFEFEF",
"-. c gray94",
";. c #F1F1F1",
":. c gray95",
">. c #F3F3F3",
",. c #F4F4F4",
"<. c gray96",
"1. c #F6F6F6",
"2. c #F8F8F8",
"3. c #F9F9F9",
"4. c gray98",
"5. c #FBFBFB",
"6. c gray99",
"7. c #FDFDFD",
"8. c #FEFEFE",
"9. c white",
/* pixels */
" > 6 3 % ",
" # s J ] ..| / F t # ",
" 0 U *.9.9.9.9.9.9.&.S % ",
" > ) 9.9.9.:.o.+.,.9.9.3.Z ",
" r &.9.:.I s 6 0 j U 3.9...0 ",
" % F ~ x # % I 9.9.b ",
" # % b 3.9.C ",
" M 9.9.V ",
" 6 / 9.3.x ",
" # > g Z ] 9.9.] 3 ",
" x R | ,.9.9.9.+.x ",
" e #.9.9.9.9.9./ s ",
" 3 ~ :.9.9.9.9.o.Z * ",
" : u m K o.9.9.9.J % ",
" e W 9.9.,.x ",
" > / 9.9.R # ",
" m 3.9.} > ",
" q #.9.o.6 ",
" : u : 0 #.9. .3 ",
"% U ,.I % b 3.9.~ % ",
"> ] 9.,.B # e ] 9.9.C ",
" F 9.9.*.L k t u C .9.9.] 3 ",
" 3 / 9.9.9.3.*.:.9.9.9.o.j ",
" 6 U *.9.9.9.9.9.3._ g ",
" % g F Q _ ) R M > ",
" # % % "
};

33
assets/text/little/3.xpm Normal file
View file

@ -0,0 +1,33 @@
/* XPM */
static char *_[] = {
/* columns rows colors chars-per-pixel */
"16 26 1 1 ",
" c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

View file

@ -0,0 +1,131 @@
/* XPM */
static char *__alpha[] = {
/* columns rows colors chars-per-pixel */
"19 26 99 2 ",
" c black",
". c #010101",
"X c #020202",
"o c gray1",
"O c #040404",
"+ c #060606",
"@ c #070707",
"# c gray3",
"$ c gray4",
"% c #0B0B0B",
"& c gray5",
"* c gray6",
"= c #101010",
"- c #131313",
"; c #151515",
": c gray9",
"> c #181818",
", c #202020",
"< c #232323",
"1 c #272727",
"2 c #282828",
"3 c gray18",
"4 c gray19",
"5 c #313131",
"6 c gray21",
"7 c gray22",
"8 c #3A3A3A",
"9 c gray23",
"0 c gray24",
"q c #3F3F3F",
"w c gray25",
"e c #414141",
"r c gray26",
"t c #484848",
"y c #494949",
"u c #4E4E4E",
"i c gray32",
"p c gray33",
"a c #555555",
"s c #5B5B5B",
"d c gray36",
"f c #646464",
"g c #656565",
"h c #6C6C6C",
"j c #717171",
"k c gray45",
"l c gray47",
"z c gray48",
"x c #808080",
"c c gray52",
"v c gray56",
"b c #959595",
"n c #9A9A9A",
"m c gray61",
"M c #9D9D9D",
"N c #9F9F9F",
"B c #A2A2A2",
"V c gray64",
"C c #A5A5A5",
"Z c #A7A7A7",
"A c gray66",
"S c #AAAAAA",
"D c #AEAEAE",
"F c gray69",
"G c gray70",
"H c gray71",
"J c #B9B9B9",
"K c gray74",
"L c #CACACA",
"P c gray80",
"I c #CECECE",
"U c gray81",
"Y c #D0D0D0",
"T c gray82",
"R c LightGray",
"E c gray83",
"W c gray84",
"Q c gray85",
"! c #DADADA",
"~ c gainsboro",
"^ c gray88",
"/ c gray89",
"( c gray90",
") c #EFEFEF",
"_ c gray94",
"` c gray95",
"' c #F3F3F3",
"] c #F4F4F4",
"[ c gray96",
"{ c #F6F6F6",
"} c gray97",
"| c #F8F8F8",
" . c #F9F9F9",
".. c gray98",
"X. c #FBFBFB",
"o. c gray99",
"O. c #FDFDFD",
"+. c #FEFEFE",
"@. c white",
/* pixels */
" + : : ",
" - c R U p ",
" + v @.@.@.C ",
" p ' @.@.@.A + ",
" , R @.@.@.@.C ",
" # n @.@.U | @.C + ",
" d [ @.U f [ @.A ",
" 2 W @.[ d e [ @.A ",
" # B @.@.A # e | @.C ",
" f [ @.^ 5 e | @.C + ",
" 3 ~ @.@.j e [ @.A ",
" * A @.@.H - e | @.C + ",
" h | @.( 9 e | @.C ",
" 0 ( @.| k e [ @.C + ",
" 1 U @.@.Q i 0 9 6 5 f | @.H , : ",
"+ M @.@.@.| [ [ [ ' ) ' @.@.[ ( W l # ",
": L @.@.@.@.@.@.@.@.@.@.@.@.@.@.@.Q , ",
" 9 x b M M C A F H J U @.@.) W U l # ",
" + + + y [ @.D : * ",
" e [ @.C ",
" e [ @.A ",
" e | @.A + ",
" y | @.A ",
" 6 ' @.B ",
" * c K u ",
" + # "
};

33
assets/text/little/4.xpm Normal file
View file

@ -0,0 +1,33 @@
/* XPM */
static char *_[] = {
/* columns rows colors chars-per-pixel */
"19 26 1 1 ",
" c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

View file

@ -0,0 +1,162 @@
/* XPM */
static char *__alpha[] = {
/* columns rows colors chars-per-pixel */
"17 26 130 2 ",
" c black",
". c #010101",
"X c #020202",
"o c gray1",
"O c #040404",
"+ c #060606",
"@ c #070707",
"# c gray3",
"$ c #090909",
"% c gray4",
"& c #0B0B0B",
"* c #0C0C0C",
"= c gray5",
"- c gray6",
"; c #101010",
": c #111111",
"> c gray7",
", c #131313",
"< c gray8",
"1 c #151515",
"2 c #161616",
"3 c #181818",
"4 c #191919",
"5 c gray10",
"6 c gray11",
"7 c gray13",
"8 c #232323",
"9 c #252525",
"0 c #272727",
"q c #282828",
"w c gray16",
"e c gray17",
"r c #2C2C2C",
"t c gray18",
"y c #2F2F2F",
"u c gray19",
"i c #323232",
"p c gray20",
"a c #353535",
"s c gray22",
"d c #393939",
"f c gray23",
"g c #3E3E3E",
"h c #3F3F3F",
"j c #434343",
"k c gray28",
"l c #484848",
"z c #494949",
"x c gray30",
"c c gray31",
"v c #505050",
"b c #535353",
"n c gray33",
"m c gray34",
"M c #585858",
"N c #5A5A5A",
"B c #5B5B5B",
"V c #626262",
"C c gray39",
"Z c #656565",
"A c gray42",
"S c #747474",
"D c gray46",
"F c #797979",
"G c gray48",
"H c #7B7B7B",
"J c #7C7C7C",
"K c gray52",
"L c #868686",
"P c gray55",
"I c gray57",
"U c #959595",
"Y c #979797",
"T c gray60",
"R c #9B9B9B",
"E c gray61",
"W c #A0A0A0",
"Q c gray63",
"! c #A5A5A5",
"~ c gray65",
"^ c #ACACAC",
"/ c gray68",
"( c #B1B1B1",
") c #B6B6B6",
"_ c #B7B7B7",
"` c #B9B9B9",
"' c gray73",
"] c gray74",
"[ c gray",
"{ c gray75",
"} c #C0C0C0",
"| c #C1C1C1",
" . c gray76",
".. c gray77",
"X. c #C5C5C5",
"o. c #C8C8C8",
"O. c gray79",
"+. c #CBCBCB",
"@. c gray80",
"#. c #CDCDCD",
"$. c #D0D0D0",
"%. c LightGray",
"&. c #D5D5D5",
"*. c gray84",
"=. c #D8D8D8",
"-. c gray85",
";. c #DDDDDD",
":. c gray87",
">. c #E4E4E4",
",. c #E6E6E6",
"<. c #E7E7E7",
"1. c gray91",
"2. c #E9E9E9",
"3. c #EAEAEA",
"4. c gray92",
"5. c gray93",
"6. c #EEEEEE",
"7. c #EFEFEF",
"8. c gray94",
"9. c gray95",
"0. c #F3F3F3",
"q. c #F6F6F6",
"w. c gray97",
"e. c #F9F9F9",
"r. c gray98",
"t. c #FBFBFB",
"y. c gray99",
"u. c #FDFDFD",
"i. c #FEFEFE",
"p. c white",
/* pixels */
" $ $ + + + $ = = $ $ 5 = ",
" z ) ` ^ ^ ( ` ] | ] ` ] *.~ 2 ",
" F p.p.p.p.p.p.p.p.p.p.p.p.0.f ",
" g 0.p.p.0.5.3.3.,.3.5.3.-.P ; ",
" e 3.p.%.g i e e 0 e t e 5 ",
" i 5.p.) $ ",
" g w.p.W ",
" v p.p.K t B F K F c 5 ",
" Z p.p.U E ,.p.p.p.p.r.o.k ",
" F p.p.w.p.p.p.p.p.p.p.p.,.j ",
" I p.p.p.p.,.E A B D @.p.p.| ; ",
"+ ~ p.p.p.o.f 0 o.p.r.B ",
"+ ) p.p.%.t C p.p.T ",
"+ U p.*.g e ,.p...= ",
" 5 v e ; *.p.-.6 ",
" ; o.p.;.8 ",
" 2 *.p.-.6 ",
" i 5.p...= ",
" J p.p.T ",
" f F t i ;.p.r.v ",
"2 o.p.o.e t | p.p.| ; ",
"; ] p.p...B e 0 i S *.p.p.3.z ",
" k >.p.p.r.3.>.0.p.p.p.5.C ",
" z o.p.p.p.p.p.p.r.o.c ",
" 5 Z W | ..` U B 2 ",
" $ ; $ + "
};

33
assets/text/little/5.xpm Normal file
View file

@ -0,0 +1,33 @@
/* XPM */
static char *_[] = {
/* columns rows colors chars-per-pixel */
"17 26 1 1 ",
" c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

View file

@ -0,0 +1,153 @@
/* XPM */
static char *__alpha[] = {
/* columns rows colors chars-per-pixel */
"17 26 121 2 ",
" c black",
". c #010101",
"X c #020202",
"o c gray1",
"O c #040404",
"+ c gray2",
"@ c #060606",
"# c #070707",
"$ c gray3",
"% c #0C0C0C",
"& c #0E0E0E",
"* c gray6",
"= c #111111",
"- c gray7",
"; c gray8",
": c #151515",
"> c #161616",
", c gray9",
"< c #181818",
"1 c #191919",
"2 c #1B1B1B",
"3 c gray11",
"4 c #1D1D1D",
"5 c #1E1E1E",
"6 c gray12",
"7 c #202020",
"8 c gray13",
"9 c #222222",
"0 c #232323",
"q c #252525",
"w c #2A2A2A",
"e c gray17",
"r c #2D2D2D",
"t c gray18",
"y c #2F2F2F",
"u c gray19",
"i c #313131",
"p c #323232",
"a c #343434",
"s c #353535",
"d c gray21",
"f c #393939",
"g c #3A3A3A",
"h c gray23",
"j c #3F3F3F",
"k c gray25",
"l c #434343",
"z c #484848",
"x c #4B4B4B",
"c c #505050",
"v c gray34",
"b c #585858",
"n c #626262",
"m c gray39",
"M c #6D6D6D",
"N c #717171",
"B c #767676",
"V c #797979",
"C c #808080",
"Z c #848484",
"A c gray55",
"S c #8E8E8E",
"D c #909090",
"F c gray57",
"G c #929292",
"H c #9D9D9D",
"J c gray62",
"K c gray63",
"L c gray64",
"P c gray67",
"I c #AEAEAE",
"U c gray69",
"Y c #B2B2B2",
"T c gray70",
"R c #B4B4B4",
"E c gray71",
"W c #B6B6B6",
"Q c #B9B9B9",
"! c gray73",
"~ c #BBBBBB",
"^ c #BCBCBC",
"/ c gray",
"( c gray75",
") c gray76",
"_ c #C6C6C6",
"` c #C8C8C8",
"' c gray79",
"] c #CACACA",
"[ c #CBCBCB",
"{ c gray80",
"} c #CECECE",
"| c gray81",
" . c #D2D2D2",
".. c gray83",
"X. c #D5D5D5",
"o. c gray84",
"O. c #D7D7D7",
"+. c #D8D8D8",
"@. c gray85",
"#. c gainsboro",
"$. c #DDDDDD",
"%. c gray87",
"&. c #DFDFDF",
"*. c gray88",
"=. c #E2E2E2",
"-. c gray89",
";. c #E6E6E6",
":. c #E7E7E7",
">. c #E9E9E9",
",. c #EAEAEA",
"<. c gray92",
"1. c #EEEEEE",
"2. c #EFEFEF",
"3. c gray94",
"4. c #F4F4F4",
"5. c gray96",
"6. c #F9F9F9",
"7. c gray98",
"8. c gray99",
"9. c #FEFEFE",
"0. c white",
/* pixels */
" * : ",
" a W _ j ",
" g O.9.9.B ",
" j O.9.9._ 8 ",
" k $.9.9.` r ",
" u O.9.9.) w ",
" < ~ 9.9.~ q ",
" C 9.9.^ 8 ",
" u -.9.-.u ",
" # G 9.9.V # 5 a a 8 % ",
" 8 $.9.3.V J @.3.3.-.) N < ",
" v 9.9.9.7.9.9.9.9.9.9.9.^ w ",
" A 9.9.9.9.2. .` O.2.9.9.9.~ : ",
"% T 9.9.2.G a : * : a G 5.9.9.m ",
"- ` 9.3.c # A 9.9.I # ",
"< O.9.*.5 r <.9. .< ",
"< O.9.*.8 : @.9.$.q ",
"- ` 9.<.w : @.9.$.8 ",
"% T 9.7.x w <.9.` : ",
" C 9.9.A m 9.9.L # ",
" k 5.9.*.r 5 ` 9.7.b ",
" * T 9.9.) a # # u T 9.9.~ - ",
" g $.9.9.-.W L W -.9.9.O.a ",
" z .9.9.9.9.9.9.7.^ a ",
" 5 M P _ } ) J v - ",
" # - : * "
};

33
assets/text/little/6.xpm Normal file
View file

@ -0,0 +1,33 @@
/* XPM */
static char *_[] = {
/* columns rows colors chars-per-pixel */
"17 26 1 1 ",
" c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

View file

@ -0,0 +1,131 @@
/* XPM */
static char *__alpha[] = {
/* columns rows colors chars-per-pixel */
"19 26 99 2 ",
" c black",
". c #010101",
"X c #020202",
"o c gray1",
"O c #040404",
"+ c gray2",
"@ c #060606",
"# c #070707",
"$ c gray3",
"% c gray4",
"& c #0B0B0B",
"* c #0C0C0C",
"= c gray5",
"- c gray6",
"; c #101010",
": c gray7",
"> c #161616",
", c gray9",
"< c #181818",
"1 c #191919",
"2 c gray10",
"3 c #1B1B1B",
"4 c gray12",
"5 c #232323",
"6 c #272727",
"7 c #282828",
"8 c gray16",
"9 c #2A2A2A",
"0 c gray18",
"q c #2F2F2F",
"w c gray19",
"e c #313131",
"r c #353535",
"t c gray22",
"y c #393939",
"u c #3C3C3C",
"i c #434343",
"p c #4B4B4B",
"a c #4E4E4E",
"s c gray32",
"d c #555555",
"f c #5F5F5F",
"g c DimGray",
"h c #6A6A6A",
"j c #717171",
"k c gray45",
"l c gray47",
"z c #7C7C7C",
"x c gray50",
"c c #808080",
"v c #868686",
"b c #9B9B9B",
"n c gray61",
"m c #9F9F9F",
"M c #A7A7A7",
"N c gray66",
"B c #A9A9A9",
"V c #AAAAAA",
"C c gray67",
"Z c #ACACAC",
"A c #AEAEAE",
"S c #B1B1B1",
"D c #B2B2B2",
"F c #B6B6B6",
"G c gray72",
"H c #BBBBBB",
"J c #C1C1C1",
"K c #C6C6C6",
"L c #CBCBCB",
"P c #CDCDCD",
"I c #CECECE",
"U c #D0D0D0",
"Y c LightGray",
"T c gray83",
"R c #D5D5D5",
"E c gray84",
"W c gray86",
"Q c #E1E1E1",
"! c gray89",
"~ c #E4E4E4",
"^ c #E7E7E7",
"/ c gray91",
"( c #E9E9E9",
") c #EAEAEA",
"_ c #ECECEC",
"` c #EEEEEE",
"' c #EFEFEF",
"] c gray94",
"[ c #F1F1F1",
"{ c #F3F3F3",
"} c #F4F4F4",
"| c gray96",
" . c #F6F6F6",
".. c #F9F9F9",
"X. c #FBFBFB",
"o. c gray99",
"O. c #FDFDFD",
"+. c #FEFEFE",
"@. c white",
/* pixels */
" O 1 1 1 > : - - $ O $ O O O O ",
"O l E E U U P K J H F S A A C C C j $ ",
"> U @.@.@.@.@.@.@.@.@.@.@.@.@.@.@.E 3 ",
"O c W Q Q ) ) _ _ { { } } @.@.@.@.v ",
" O 1 5 5 6 9 0 e r y y g _ @.@.F > ",
" : S @.@.P 9 ",
" c @.@.^ i ",
" y ) @.@.k ",
" $ A @.@.F : ",
" d } @._ i ",
" - H @.@.n O ",
" a } @.) y ",
" O C @.@.M O ",
" e ^ @.} p ",
" x @.@.H $ ",
" > P @...g ",
" d ..@.P > ",
" O C @.@.l ",
" e ) @.) 0 ",
" x @.@.S $ ",
" > P @.@.g ",
" s ..@.Q 9 ",
" b @.@.n O ",
" $ H @.{ i ",
" d J x $ ",
" - "
};

33
assets/text/little/7.xpm Normal file
View file

@ -0,0 +1,33 @@
/* XPM */
static char *_[] = {
/* columns rows colors chars-per-pixel */
"19 26 1 1 ",
" c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

View file

@ -0,0 +1,162 @@
/* XPM */
static char *__alpha[] = {
/* columns rows colors chars-per-pixel */
"17 26 130 2 ",
" c black",
". c #010101",
"X c #020202",
"o c gray1",
"O c #040404",
"+ c gray2",
"@ c #060606",
"# c #070707",
"$ c gray3",
"% c #090909",
"& c gray4",
"* c #0B0B0B",
"= c #0C0C0C",
"- c gray5",
"; c #0E0E0E",
": c gray6",
"> c #101010",
", c #111111",
"< c #131313",
"1 c gray8",
"2 c #161616",
"3 c gray11",
"4 c #1D1D1D",
"5 c #1E1E1E",
"6 c #202020",
"7 c gray13",
"8 c #222222",
"9 c gray14",
"0 c #252525",
"q c gray15",
"w c #272727",
"e c #2A2A2A",
"r c gray17",
"t c #2D2D2D",
"y c #2F2F2F",
"u c #313131",
"i c #343434",
"p c #393939",
"a c gray24",
"s c #3E3E3E",
"d c #414141",
"f c #434343",
"g c gray28",
"h c #494949",
"j c gray29",
"k c #4C4C4C",
"l c #4E4E4E",
"z c #535353",
"x c #555555",
"c c #585858",
"v c gray35",
"b c gray36",
"n c gray37",
"m c #606060",
"M c gray39",
"N c #676767",
"B c #686868",
"V c DimGray",
"C c gray42",
"Z c #6F6F6F",
"A c gray44",
"S c #727272",
"D c #747474",
"F c gray46",
"G c #7B7B7B",
"H c #868686",
"J c gray53",
"K c #8B8B8B",
"L c gray55",
"P c #8E8E8E",
"I c #959595",
"U c gray59",
"Y c #9A9A9A",
"T c #9D9D9D",
"R c gray62",
"E c #A2A2A2",
"W c #A5A5A5",
"Q c gray65",
"! c #A7A7A7",
"~ c #A9A9A9",
"^ c gray68",
"/ c #AFAFAF",
"( c gray71",
") c #B6B6B6",
"_ c gray73",
"` c gray74",
"' c #C0C0C0",
"] c #C1C1C1",
"[ c #C3C3C3",
"{ c gray77",
"} c #C6C6C6",
"| c gray78",
" . c #C8C8C8",
".. c gray79",
"X. c gray80",
"o. c #CDCDCD",
"O. c #CECECE",
"+. c gray81",
"@. c #D0D0D0",
"#. c gray82",
"$. c #D2D2D2",
"%. c gray83",
"&. c #D5D5D5",
"*. c gray85",
"=. c #DDDDDD",
"-. c gray87",
";. c gray88",
":. c #E1E1E1",
">. c gray89",
",. c #E4E4E4",
"<. c #E6E6E6",
"1. c gray91",
"2. c #EAEAEA",
"3. c gray92",
"4. c gray93",
"5. c #EEEEEE",
"6. c #EFEFEF",
"7. c gray94",
"8. c gray95",
"9. c #F3F3F3",
"0. c #F4F4F4",
"q. c #F6F6F6",
"w. c gray97",
"e. c #F8F8F8",
"r. c #F9F9F9",
"t. c gray98",
"y. c #FBFBFB",
"u. c gray99",
"i. c #FEFEFE",
"p. c white",
/* pixels */
" - < < @ ",
" @ s P ` .} / F 8 ",
" < K 6.p.p.p.p.p.p.%.d ",
" - T p.p.0.$.[ .6.p.p.$.8 ",
" N t.p.$.l 1 * - s o.p.p.Z ",
" - [ p.8.h b p.p.~ ",
" t 2.p. .- t 6.p.} - ",
" p 8.p.( @ e 2.p. .- ",
" t 6.p.%.3 N t.p.( @ ",
" < } p.p.Q q < b ;.p.p.F ",
" m 0.p.p.-.I H .t.p.p.Q 1 ",
" * G 8.p.p.p.p.p.p.t.H < ",
" d -.p.p.p.p.p.p.p. .z @ ",
" h ,.p.p.8.E V / 6.p.p.8.S ",
" 3 $.p.p.} g @ @ d [ p.p.6.d ",
" V p.p.} 8 8 } p.p.Y ",
"@ Q p.t.v b p.p.o.1 ",
"- } p.,.e i 6.p.;.q ",
"1 $.p.-.3 t 6.p.;.e ",
"< .p.2.t h t.p.*.3 ",
"@ Q p.p.P @ @ T p.p./ * ",
" x t.p.0.I i < * < t P 0.p.0.x ",
" - T p.p.p.6.o.[ .2.p.p.p.P @ ",
" 1 H ,.p.p.p.p.p.p.p.-.S - ",
" @ t F Q ` [ _ T N q ",
" - - * "
};

33
assets/text/little/8.xpm Normal file
View file

@ -0,0 +1,33 @@
/* XPM */
static char *_[] = {
/* columns rows colors chars-per-pixel */
"17 26 1 1 ",
" c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

View file

@ -0,0 +1,150 @@
/* XPM */
static char *__alpha[] = {
/* columns rows colors chars-per-pixel */
"17 26 118 2 ",
" c black",
". c #010101",
"X c #020202",
"o c gray1",
"O c #040404",
"+ c gray2",
"@ c #060606",
"# c #070707",
"$ c gray3",
"% c gray4",
"& c #0C0C0C",
"* c gray5",
"= c #0E0E0E",
"- c gray6",
"; c #101010",
": c #111111",
"> c gray8",
", c #161616",
"< c gray9",
"1 c #191919",
"2 c gray10",
"3 c #1E1E1E",
"4 c gray12",
"5 c #202020",
"6 c gray13",
"7 c #232323",
"8 c gray14",
"9 c #252525",
"0 c #272727",
"q c #282828",
"w c gray16",
"e c #2A2A2A",
"r c gray18",
"t c gray19",
"y c #313131",
"u c gray20",
"i c #343434",
"p c #373737",
"a c gray22",
"s c #3C3C3C",
"d c gray24",
"f c #3E3E3E",
"g c #434343",
"h c #464646",
"j c #484848",
"k c #4B4B4B",
"l c gray31",
"z c gray33",
"x c #565656",
"c c #585858",
"v c #5D5D5D",
"b c #5F5F5F",
"n c #656565",
"m c gray42",
"M c gray44",
"N c #727272",
"B c #747474",
"V c #767676",
"C c #777777",
"Z c gray47",
"A c #7B7B7B",
"S c #7C7C7C",
"D c #808080",
"F c #888888",
"G c #8B8B8B",
"H c #8E8E8E",
"J c gray57",
"K c #939393",
"L c #979797",
"P c #9B9B9B",
"I c gray63",
"U c #A2A2A2",
"Y c gray68",
"T c #B1B1B1",
"R c gray70",
"E c #B4B4B4",
"W c #B7B7B7",
"Q c gray72",
"! c #B9B9B9",
"~ c gray",
"^ c #C1C1C1",
"/ c gray76",
"( c #C3C3C3",
") c #C5C5C5",
"_ c #C6C6C6",
"` c gray78",
"' c #C8C8C8",
"] c #CDCDCD",
"[ c #CECECE",
"{ c gray81",
"} c #D0D0D0",
"| c #D2D2D2",
" . c LightGray",
".. c gray83",
"X. c #D7D7D7",
"o. c #D8D8D8",
"O. c gray86",
"+. c gainsboro",
"@. c #DDDDDD",
"#. c gray87",
"$. c gray88",
"%. c #E2E2E2",
"&. c gray89",
"*. c #E4E4E4",
"=. c gray90",
"-. c #EAEAEA",
";. c #ECECEC",
":. c gray93",
">. c #EEEEEE",
",. c gray94",
"<. c gray95",
"1. c gray96",
"2. c gray97",
"3. c #F9F9F9",
"4. c #FBFBFB",
"5. c gray99",
"6. c #FEFEFE",
"7. c white",
/* pixels */
" @ > 7 3 * ",
" 3 m Y .+.O.~ B 1 ",
" x .7.7.7.7.7.7.7._ p ",
" c >.7.2.( J S U -.7.7.X.y ",
" 7 X.7.-.n * g X.7.7.R * ",
" B 7.7.S f %.7.3.x ",
"$ R 7.=.q Z 7.7.U @ ",
"1 .7._ * 0 %.7.] ; ",
"0 +.7.! $ * ' 7.+.7 ",
"3 +.7._ ; ; ' 7.+.7 ",
"; _ 7.-.s 7 +.7.X.1 ",
" H 7.7.R 1 y E 7.7.~ * ",
" p =.7.7.( c q 7 y Z %.7.7.7.U ",
" n >.7.7.3.-.+.>.7.7.7.7.7.N ",
" @ z ] 7.7.7.7.7.2. .<.7.<.s ",
" 1 v L R R G h v 2.7._ * ",
" @ @ * R 7.7.B ",
" n 3.7.O.0 ",
" f %.7.7.Z ",
" @ k X.7.7.E > ",
" e J >.7.7.] e ",
" > l P %.7.7.7.~ y ",
" h .3.7.7.7.%.Z 1 ",
" J 7.7.7.+.G q @ ",
" h ( ! N 0 ",
" * $ "
};

33
assets/text/little/9.xpm Normal file
View file

@ -0,0 +1,33 @@
/* XPM */
static char *_[] = {
/* columns rows colors chars-per-pixel */
"17 26 1 1 ",
" c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

3
dev/CREATE_TEXT.md Normal file
View file

@ -0,0 +1,3 @@
- use https://www.fontbolt.com/font/comic-sans/
- black on transparent
- convert it using the good scripts

10
dev/import_assets_text_26px.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
for PNG in $(find . -type f -name "*.png")
do
# resize
convert "$PNG" -resize x26 "$PNG"
# extract color and alpha
convert "$PNG" -negate -alpha opaque "${PNG%.png}.xpm"
convert "$PNG" -alpha extract "${PNG%.png}.alpha.xpm"
rm "$PNG"
done

View file

@ -6,14 +6,14 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/29 17:43:01 by mcolonna #+# #+# */
/* Updated: 2024/04/18 17:05:31 by mcolonna ### ########.fr */
/* Updated: 2024/04/18 20:07:12 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef DATA_ASSETS_H
# define DATA_ASSETS_H
# define NB_ASSETS 97
# define NB_ASSETS 107
typedef struct s_assetmeta
{
@ -130,6 +130,16 @@ typedef enum e_assetsmap_id
ANIM_EXPLOSION_PART2_7,
ANIM_EXPLOSION_PART2_8,
ANIM_EXPLOSION_PART2_9,
TEXT_LITTLE_0,
TEXT_LITTLE_1,
TEXT_LITTLE_2,
TEXT_LITTLE_3,
TEXT_LITTLE_4,
TEXT_LITTLE_5,
TEXT_LITTLE_6,
TEXT_LITTLE_7,
TEXT_LITTLE_8,
TEXT_LITTLE_9,
TEXT_GAMEOVER,
TEXT_YOUDED,
} t_assetsmap_id;

21
includes/display/text.h Normal file
View file

@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* text.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/18 19:54:06 by mcolonna #+# #+# */
/* Updated: 2024/04/18 20:02:12 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef TEXT_H
# define TEXT_H
# include "includes.h"
void display_text(t_point *p, t_assetsmap_id asset);
void display_uint(t_point *p, unsigned int n);
#endif

View file

@ -6,13 +6,14 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/02 13:53:41 by mcolonna #+# #+# */
/* Updated: 2024/04/18 17:59:26 by mcolonna ### ########.fr */
/* Updated: 2024/04/18 21:00:20 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef INCLUDES_H
# define INCLUDES_H
# include <math.h>
# include <fcntl.h>
# include <time.h>
# include <stdbool.h>
@ -35,6 +36,7 @@
# include "display/data_sprites.h"
# include "display/display.h"
# include "display/sprite.h"
# include "display/text.h"
# include "main/error.h"

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/26 16:27:06 by mcolonna #+# #+# */
/* Updated: 2024/04/18 16:52:02 by mcolonna ### ########.fr */
/* Updated: 2024/04/18 20:52:29 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -122,6 +122,16 @@ const t_assetmeta g_assetsmap[NB_ASSETS] = {
{"anim/explosion_part2_8", 0, 100, 0, 141, false},
{"anim/explosion_part2_9", 0, 100, 0, 141, false},
// TEXT
{"text/little/0", 0, 600, 0, 100, false},
{"text/little/1", 0, 600, 0, 100, false},
{"text/little/2", 0, 600, 0, 100, false},
{"text/little/3", 0, 600, 0, 100, false},
{"text/little/4", 0, 600, 0, 100, false},
{"text/little/5", 0, 600, 0, 100, false},
{"text/little/6", 0, 600, 0, 100, false},
{"text/little/7", 0, 600, 0, 100, false},
{"text/little/8", 0, 600, 0, 100, false},
{"text/little/9", 0, 600, 0, 100, false},
{"text/gameover", 100, 510, 120, 190, false},
{"text/youded", 240, 360, 230, 280, false},
};

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/26 15:05:30 by mcolonna #+# #+# */
/* Updated: 2024/04/09 15:29:39 by mcolonna ### ########.fr */
/* Updated: 2024/04/18 20:11:30 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -44,13 +44,7 @@ void display_erase(void)
void display_flush(void)
{
const t_memclass mc = mem_subclass(error_err, g_env.mc);
t_string str;
mlx_put_image_to_window(g_env.mlx, g_env.win, g_screenbuf.img, 0, 0);
str = str_inttostr(error_err, mc, g_env.moves);
mlx_string_put(g_env.mlx, g_env.win, 0, 10, 0xFFFFFF, str);
mem_freeall(mc);
}
void display_destroyall(void)

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/26 15:05:30 by mcolonna #+# #+# */
/* Updated: 2024/04/11 17:22:45 by mcolonna ### ########.fr */
/* Updated: 2024/04/18 21:03:27 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -37,18 +37,10 @@ static inline t_imglimits get_limits(t_point p, t_image img)
{
t_imglimits r;
r.xmin = -p.x;
if (img.asset.limit_left > r.xmin)
r.xmin = img.asset.limit_left;
r.xmax = WINDOW_WIDTH - p.x;
if (img.asset.limit_right < r.xmax)
r.xmax = img.asset.limit_right;
r.ymin = -p.y;
if (img.asset.limit_up > r.ymin)
r.ymin = img.asset.limit_up;
r.ymax = WINDOW_HEIGHT - p.y;
if (img.asset.limit_down < r.ymax)
r.ymax = img.asset.limit_down;
r.xmin = fmax(-p.x, fmax(img.asset.limit_left, 0));
r.xmax = fmin(WINDOW_WIDTH - p.x, fmin(img.asset.limit_right, img.width));
r.ymin = fmax(-p.y, fmax(img.asset.limit_up, 0));
r.ymax = fmin(WINDOW_HEIGHT - p.y, fmin(img.asset.limit_down, img.height));
return (r);
}

34
src/display/text.c Normal file
View file

@ -0,0 +1,34 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* text.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/18 19:57:28 by mcolonna #+# #+# */
/* Updated: 2024/04/18 20:22:33 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes.h"
#include "display_utils.h"
void display_text(t_point *p, t_assetsmap_id asset)
{
display_draw(*p, asset);
p->x += g_allassets[asset].width;
}
void display_uint(t_point *p, unsigned int n)
{
const t_memclass mc = mem_subclass(error_err, g_env.mc);
t_string str;
str = str_uinttostr(error_err, mc, n);
while (*str)
{
display_text(p, TEXT_LITTLE_0 + *str - '0');
str++;
}
mem_freeall(mc);
}

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/09 15:11:29 by mcolonna #+# #+# */
/* Updated: 2024/04/18 14:36:25 by mcolonna ### ########.fr */
/* Updated: 2024/04/18 21:09:31 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -119,28 +119,8 @@ void room_init(t_const_string path)
void room_draw(void)
{
t_point p;
t_object *obj;
camera_sync();
p.y = -1;
while (++p.y < g_env.room.height)
{
p.x = -1;
while (++p.x < g_env.room.width)
sprite_draw(to_camera_pos(p),
g_env.room.surfaces + p.y * g_env.room.width + p.x);
}
p.y = -1;
while (++p.y < g_env.room.height)
{
p.x = -1;
while (++p.x < g_env.room.width)
{
obj = g_env.room.objects[p.y * g_env.room.width + p.x];
if (obj)
obj->type.draw(obj, to_camera_pos(p));
visual_loop(&g_env.room.visuals[p.y * g_env.room.width + p.x],
to_camera_pos(p));
}
}
room_drawsurfaceandobjects();
p = point_init(10, 4);
display_uint(&p, g_env.moves);
}

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/09 15:23:43 by mcolonna #+# #+# */
/* Updated: 2024/04/18 13:34:08 by mcolonna ### ########.fr */
/* Updated: 2024/04/18 21:08:02 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -26,5 +26,6 @@ int room_count(t_object_init objtype);
void room_checkwallsallaround(t_const_string path, t_room *room);
t_point to_camera_pos(t_point p);
void room_checkaccessibilities(t_const_string path);
void room_drawsurfaceandobjects(void);
#endif

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/09 16:04:41 by mcolonna #+# #+# */
/* Updated: 2024/04/11 17:24:53 by mcolonna ### ########.fr */
/* Updated: 2024/04/18 21:09:01 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -51,3 +51,32 @@ t_point to_camera_pos(t_point p)
r.y = p.y * 50 - g_env.camera.pos.y;
return (r);
}
void room_drawsurfaceandobjects(void)
{
t_point p;
t_object *obj;
camera_sync();
p.y = -1;
while (++p.y < g_env.room.height)
{
p.x = -1;
while (++p.x < g_env.room.width)
sprite_draw(to_camera_pos(p),
g_env.room.surfaces + p.y * g_env.room.width + p.x);
}
p.y = -1;
while (++p.y < g_env.room.height)
{
p.x = -1;
while (++p.x < g_env.room.width)
{
obj = g_env.room.objects[p.y * g_env.room.width + p.x];
if (obj)
obj->type.draw(obj, to_camera_pos(p));
visual_loop(&g_env.room.visuals[p.y * g_env.room.width + p.x],
to_camera_pos(p));
}
}
}