add level 1 to binary levels

This commit is contained in:
Milang 2020-02-02 17:55:03 +01:00
parent ddef97b66b
commit a8a8550e05
7 changed files with 25 additions and 2 deletions

Binary file not shown.

BIN
assets-fx/bin/lvl_1_1.png Normal file

Binary file not shown.

Binary file not shown.

BIN
levelconverter/1_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@ -21,6 +21,8 @@ goomba = (127, 76, 0)
koopa_vert = (25, 127, 0)
koopa_rouge = (127, 0, 0)
mario_start = (108, 81, 47)
def color_compare(color1, color2):
if color1[0] == color2[0] and color1[1] == color2[1] and color1[2] == color2[2]:
return 1
@ -93,6 +95,9 @@ for x in range(0,img.size[0]):
elif color_compare(pixels[x,y], koopa_rouge):
code += write_char(13)
elif color_compare(pixels[x,y], mario_start):
code += write_char(14)
else:
code += write_char(0)

View File

@ -26,11 +26,10 @@
#define PACKED_TUYAU_BOUT 8
#define PACKED_TUYAU_MIDDLE 9
#define PACKED_FLAG 10
#define PACKED_GOOMBA 11
#define PACKED_KOOPA_VERT 12
#define PACKED_KOOPA_ROUGE 13
#define PACKED_MARIO_START 14
void malloc_error()
{
@ -292,6 +291,12 @@ static void unpack_level(packed_level_t * p)
ennemis[nombre_ennemis]=e;
nombre_ennemis++;
}
if (contents==PACKED_MARIO_START)
{
sx=8*x;
sy=8*y;
}
}
}
ll_sendp(LEVEL_INFO, "\n[i]Converted!\n[i]Sending to level zone...", w,h);
@ -315,6 +320,19 @@ void set_level(int w, int l)
ennemis_global_size=0;
plateforme_table_size=0;
if (w+1==1 && l+1==1) // 1-2
{
extern packed_level_t bin_lvl_1_1;
unpack_level(&bin_lvl_1_1);
teleport_t t[]=
{
{57,6, 215,12, MK_DOWN},
{227,2, 179,3, MK_RIGHT}
};
set_teleporteurs(t, sizeof(t)/sizeof(teleport_t));
}
if (w+1==1 && l+1==2) // 1-2
{
extern packed_level_t bin_lvl_1_2;