2019-11-24 14:28:04 +01:00
|
|
|
#include "level.h"
|
|
|
|
#include "world.h"
|
2019-11-25 19:12:25 +01:00
|
|
|
#include "mario.h"
|
2019-11-30 13:57:18 +01:00
|
|
|
#include "score.h"
|
2019-12-03 19:53:30 +01:00
|
|
|
#include "ennemi.h"
|
2020-01-06 18:43:36 +01:00
|
|
|
#include "keyboard.h"
|
2020-01-11 15:19:53 +01:00
|
|
|
#include <plateforme.h>
|
2020-01-23 21:03:58 +01:00
|
|
|
#include <tuyau.h>
|
2020-01-11 15:19:53 +01:00
|
|
|
|
2019-11-24 14:28:04 +01:00
|
|
|
#include <gint/display.h>
|
2019-11-30 13:57:18 +01:00
|
|
|
#include <gint/std/stdlib.h>
|
|
|
|
#include <gint/keyboard.h>
|
|
|
|
#include <gint/timer.h>
|
|
|
|
#include <gint/std/string.h>
|
2020-01-23 21:03:58 +01:00
|
|
|
#include <gint/std/stdio.h>
|
2020-02-02 16:05:56 +01:00
|
|
|
#include <liblog.h>
|
2020-02-04 20:12:17 +01:00
|
|
|
#include <base.h>
|
2020-01-11 15:19:53 +01:00
|
|
|
|
2020-02-01 16:39:34 +01:00
|
|
|
#define PACKED_EMPTY 0
|
|
|
|
#define PACKED_STONE 1
|
|
|
|
#define PACKED_COIN 2
|
|
|
|
#define PACKED_BRICK 3
|
|
|
|
#define PACKED_BRICK_COIN 4
|
|
|
|
#define PACKED_BOX_COIN 5
|
|
|
|
#define PACKED_BOX_CHAMPI 6
|
|
|
|
#define PACKED_BETON 7
|
|
|
|
#define PACKED_TUYAU_BOUT 8
|
|
|
|
#define PACKED_TUYAU_MIDDLE 9
|
2020-02-02 16:05:56 +01:00
|
|
|
#define PACKED_FLAG 10
|
2020-02-02 16:48:23 +01:00
|
|
|
#define PACKED_GOOMBA 11
|
|
|
|
#define PACKED_KOOPA_VERT 12
|
|
|
|
#define PACKED_KOOPA_ROUGE 13
|
2020-02-02 17:55:03 +01:00
|
|
|
#define PACKED_MARIO_START 14
|
2020-02-02 20:31:44 +01:00
|
|
|
#define PACKED_NUAGE 15
|
2020-02-04 20:12:17 +01:00
|
|
|
#define PACKED_ARBRE_TRONC 16
|
|
|
|
#define PACKED_ARBRE_FEUILLES 17
|
2020-03-07 15:22:39 +01:00
|
|
|
#define PACKED_PLANTE 18
|
2020-02-02 16:48:23 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
void mallocError()
|
2019-11-24 14:28:04 +01:00
|
|
|
{
|
2019-11-30 13:57:18 +01:00
|
|
|
extern image_t img_ram;
|
|
|
|
timer_stop(0);
|
|
|
|
dimage(0,0,&img_ram);
|
|
|
|
dupdate();
|
2020-02-16 20:43:35 +01:00
|
|
|
while (1) MKB_getkey();
|
2019-11-30 13:57:18 +01:00
|
|
|
}
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
static uint8_t packAccess(packed_level_t const * const p, unsigned int x, unsigned int y)
|
2020-02-01 16:39:34 +01:00
|
|
|
{
|
2020-02-16 20:43:35 +01:00
|
|
|
if (x<p->width && y<p->height) return p->data[x*p->height+y];
|
|
|
|
else return PACKED_EMPTY;
|
2020-02-01 16:39:34 +01:00
|
|
|
}
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
static void cellSet(cell_t *const array, unsigned int w, unsigned int h, unsigned int x, unsigned int y, cell_t const cell)
|
2020-02-01 16:39:34 +01:00
|
|
|
{
|
2020-02-16 20:43:35 +01:00
|
|
|
if (x<w && y<h) array[x*h+y] = cell;
|
2020-02-01 16:39:34 +01:00
|
|
|
}
|
|
|
|
|
2019-11-30 13:57:18 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
static void unpackLevel(packed_level_t * p)
|
2020-01-11 15:19:53 +01:00
|
|
|
{
|
2020-02-02 16:05:56 +01:00
|
|
|
unsigned int w = p->width;
|
|
|
|
unsigned int h = p->height;
|
|
|
|
|
|
|
|
ll_sendp(LEVEL_INFO, "\nUnpacking level %dx%d", w,h);
|
2020-02-01 16:39:34 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
cell_t * c = (cell_t *) mallocProf(sizeof(cell_t) * w * h);
|
2020-02-02 16:05:56 +01:00
|
|
|
ll_sendp(LEVEL_INFO, "\n[i]malloc %d", sizeof(cell_t) * w * h);
|
2020-02-01 16:39:34 +01:00
|
|
|
if (c==0)
|
2020-02-02 16:05:56 +01:00
|
|
|
{ // overriding parameters
|
2020-02-01 16:39:34 +01:00
|
|
|
|
2020-02-02 16:05:56 +01:00
|
|
|
w = 232;//p->width;
|
|
|
|
h = 13;//p->height;
|
2020-02-03 11:12:54 +01:00
|
|
|
ll_sendp(LEVEL_CRITICAL, "\n[e]malloc %d failed !\n[i]Trying defaults:\n %dx%d",sizeof(cell_t) * w * h, w,h);
|
2020-02-02 16:05:56 +01:00
|
|
|
ll_sendp(LEVEL_WARNING, "\n[w]writing into pack new coordinates:\n %dx%d", w,h);
|
|
|
|
|
|
|
|
p->width=w;
|
|
|
|
p->height=h;
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
cell_t * c = (cell_t *) mallocProf(sizeof(cell_t) * w * h);
|
2020-02-02 16:05:56 +01:00
|
|
|
if (c==0)
|
2020-02-16 20:43:35 +01:00
|
|
|
mallocError();
|
2020-02-02 16:05:56 +01:00
|
|
|
}
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
//ll_setLevel(LEVEL_WARNING);
|
2020-02-01 16:39:34 +01:00
|
|
|
|
2020-02-02 16:05:56 +01:00
|
|
|
int sx=0, sy=p->height; // Mario start coords
|
2020-02-02 16:48:23 +01:00
|
|
|
|
2020-03-07 15:22:39 +01:00
|
|
|
ennemi_t ennemis[30]={0};
|
2020-02-02 16:48:23 +01:00
|
|
|
int nombre_ennemis=0;
|
|
|
|
|
|
|
|
|
2020-02-02 16:05:56 +01:00
|
|
|
for (unsigned int x=0; x<w; x++)
|
2020-01-13 20:26:37 +01:00
|
|
|
{
|
2020-02-02 16:05:56 +01:00
|
|
|
for (unsigned int y=0; y<h; y++)
|
2020-02-01 16:39:34 +01:00
|
|
|
{
|
2020-02-16 20:43:35 +01:00
|
|
|
unsigned int contents = packAccess(p,x,y);
|
2020-02-01 16:39:34 +01:00
|
|
|
cell_t cell = {0,0};
|
|
|
|
if (contents==PACKED_EMPTY)
|
|
|
|
{
|
|
|
|
cell_t t={0,0};
|
|
|
|
cell = t;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_STONE)
|
|
|
|
{
|
|
|
|
int props=0;
|
|
|
|
{ // determiner x
|
|
|
|
int px=1;
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x-1,y)!=PACKED_STONE)
|
|
|
|
px=0;
|
|
|
|
if (packAccess(p,x+1,y)!=PACKED_STONE)
|
|
|
|
px=2;
|
2020-02-01 16:39:34 +01:00
|
|
|
props+=16*px;
|
|
|
|
}
|
|
|
|
{ // determiner y
|
|
|
|
int py=1;
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x,y+1)!=PACKED_STONE)
|
|
|
|
py=0;
|
2020-02-01 16:39:34 +01:00
|
|
|
props+=py;
|
|
|
|
}
|
|
|
|
cell_t t={EARTH,props};
|
|
|
|
cell = t;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_COIN)
|
|
|
|
{
|
|
|
|
cell_t t={COIN,0};
|
|
|
|
cell = t;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_BRICK)
|
|
|
|
{
|
|
|
|
cell_t t={BRICK,0};
|
|
|
|
cell = t;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_BRICK_COIN)
|
|
|
|
{
|
|
|
|
cell_t t={BRICK,0x15};
|
|
|
|
cell = t;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_BOX_COIN)
|
|
|
|
{
|
|
|
|
cell_t t={GIFT,0x11};
|
|
|
|
cell = t;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_BOX_CHAMPI)
|
|
|
|
{
|
|
|
|
cell_t t={GIFT,0x21};
|
|
|
|
cell = t;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_BETON)
|
|
|
|
{
|
|
|
|
cell_t t={BLOC,0};
|
|
|
|
cell = t;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_TUYAU_BOUT)
|
|
|
|
{
|
2020-02-02 16:05:56 +01:00
|
|
|
int px=0, py=0;
|
2020-02-01 16:39:34 +01:00
|
|
|
int props=0;
|
2020-01-28 14:32:39 +01:00
|
|
|
|
2020-02-01 16:39:34 +01:00
|
|
|
{ // haut du tuyau horizontal
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x-1,y)==PACKED_TUYAU_BOUT)
|
2020-02-01 16:39:34 +01:00
|
|
|
{
|
2020-02-02 16:05:56 +01:00
|
|
|
px=1;
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x,y-1)==PACKED_TUYAU_MIDDLE)
|
|
|
|
py=2;
|
|
|
|
if (packAccess(p,x,y+1)==PACKED_TUYAU_MIDDLE)
|
|
|
|
py=4;
|
2020-02-01 16:39:34 +01:00
|
|
|
}
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x+1,y)==PACKED_TUYAU_BOUT)
|
2020-02-01 16:39:34 +01:00
|
|
|
{
|
2020-02-02 16:05:56 +01:00
|
|
|
px=0;
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x,y-1)==PACKED_TUYAU_MIDDLE)
|
|
|
|
py=2;
|
|
|
|
if (packAccess(p,x,y+1)==PACKED_TUYAU_MIDDLE)
|
|
|
|
py=4;
|
2020-02-01 16:39:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{ // bout de tuyau vertical
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x,y-1)==PACKED_TUYAU_BOUT)
|
2020-02-01 16:39:34 +01:00
|
|
|
{
|
2020-02-02 16:05:56 +01:00
|
|
|
py=0;
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x+1,y)==PACKED_TUYAU_MIDDLE)
|
|
|
|
px=0;
|
|
|
|
if (packAccess(p,x-1,y)==PACKED_TUYAU_MIDDLE)
|
|
|
|
px=2;
|
2020-02-01 16:39:34 +01:00
|
|
|
}
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x,y+1)==PACKED_TUYAU_BOUT)
|
2020-02-01 16:39:34 +01:00
|
|
|
{
|
2020-02-02 16:05:56 +01:00
|
|
|
py=1;
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x+1,y)==PACKED_TUYAU_MIDDLE)
|
|
|
|
px=0;
|
|
|
|
if (packAccess(p,x-1,y)==PACKED_TUYAU_MIDDLE)
|
|
|
|
px=2;
|
2020-02-02 16:05:56 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
props=16*px+py;
|
|
|
|
cell_t t={TUYAU,props};
|
|
|
|
cell = t;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_TUYAU_MIDDLE)
|
|
|
|
{
|
|
|
|
int px=0, py=0;
|
|
|
|
int props=0;
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
if (/*packAccess(p,x-1,y)==PACKED_TUYAU_MIDDLE && */packAccess(p,x+1,y)!=PACKED_TUYAU_MIDDLE)
|
2020-02-02 16:05:56 +01:00
|
|
|
{
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x+1,y)==PACKED_TUYAU_BOUT)
|
2020-02-02 16:05:56 +01:00
|
|
|
{
|
|
|
|
px=1;
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x,y+1)!=PACKED_TUYAU_MIDDLE)
|
|
|
|
py=0;
|
2020-02-02 16:05:56 +01:00
|
|
|
else
|
2020-02-16 20:43:35 +01:00
|
|
|
py=1;
|
2020-02-02 16:05:56 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
px=1;
|
|
|
|
py=3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
if (/*packAccess(p,x+1,y)==PACKED_TUYAU_MIDDLE && */packAccess(p,x-1,y)!=PACKED_TUYAU_MIDDLE)
|
2020-02-02 16:05:56 +01:00
|
|
|
{
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x-1,y)==PACKED_TUYAU_BOUT)
|
2020-02-02 16:05:56 +01:00
|
|
|
{
|
|
|
|
px=1;
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x,y+1)!=PACKED_TUYAU_MIDDLE)
|
|
|
|
py=0;
|
2020-02-02 16:05:56 +01:00
|
|
|
else
|
2020-02-16 20:43:35 +01:00
|
|
|
py=1;
|
2020-02-02 16:05:56 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
px=0;
|
|
|
|
py=3;
|
2020-02-01 16:39:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-02 16:05:56 +01:00
|
|
|
props=16*px+py;
|
2020-02-01 16:39:34 +01:00
|
|
|
cell_t t={TUYAU,props};
|
|
|
|
cell = t;
|
|
|
|
}
|
2020-02-02 16:05:56 +01:00
|
|
|
else if (contents==PACKED_FLAG)
|
|
|
|
{
|
|
|
|
int props=0;
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x,y+1)!=PACKED_FLAG)
|
|
|
|
props=0x1400;
|
|
|
|
else if (packAccess(p,x,y+2)!=PACKED_FLAG)
|
|
|
|
props=0x1401;
|
|
|
|
else if (packAccess(p,x,y+3)!=PACKED_FLAG)
|
|
|
|
props=0x1302;
|
|
|
|
else if (packAccess(p,x,y+4)!=PACKED_FLAG)
|
|
|
|
props=0x1302;
|
|
|
|
else if (packAccess(p,x,y+5)!=PACKED_FLAG)
|
|
|
|
props=0x1202;
|
|
|
|
else if (packAccess(p,x,y+6)!=PACKED_FLAG)
|
|
|
|
props=0x1202;
|
2020-02-02 16:05:56 +01:00
|
|
|
else
|
2020-02-16 20:43:35 +01:00
|
|
|
props=0x1102;
|
2020-02-02 16:05:56 +01:00
|
|
|
cell_t t={END_LEVEL,props};
|
|
|
|
cell = t;
|
|
|
|
}
|
2020-02-02 20:31:44 +01:00
|
|
|
else if (contents==PACKED_NUAGE)
|
|
|
|
{
|
|
|
|
int px=1, py=0;
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x,y+1)==PACKED_NUAGE)
|
|
|
|
py=1;
|
2020-02-02 20:31:44 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x-1,y)!=PACKED_NUAGE)
|
|
|
|
px=0;
|
|
|
|
if (packAccess(p,x+1,y)!=PACKED_NUAGE)
|
|
|
|
px=2;
|
2020-02-02 20:31:44 +01:00
|
|
|
|
|
|
|
cell_t t={NUAGE,16*px+py};
|
|
|
|
cell = t;
|
|
|
|
}
|
2020-02-04 20:12:17 +01:00
|
|
|
else if (contents==PACKED_ARBRE_TRONC)
|
|
|
|
{
|
|
|
|
cell_t t={ARBRE,0x11};
|
|
|
|
cell = t;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_ARBRE_FEUILLES)
|
|
|
|
{
|
|
|
|
int px=0;
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x+1,y)==PACKED_ARBRE_FEUILLES)
|
2020-02-04 20:12:17 +01:00
|
|
|
{
|
2020-02-16 20:43:35 +01:00
|
|
|
if (packAccess(p,x-1,y)==PACKED_ARBRE_FEUILLES)
|
|
|
|
px=1;
|
2020-02-04 20:12:17 +01:00
|
|
|
else
|
2020-02-16 20:43:35 +01:00
|
|
|
px=0;
|
2020-02-04 20:12:17 +01:00
|
|
|
}
|
|
|
|
else
|
2020-02-16 20:43:35 +01:00
|
|
|
px=2;
|
2020-02-04 20:12:17 +01:00
|
|
|
cell_t t={ARBRE,16*px};
|
|
|
|
cell = t;
|
|
|
|
}
|
2020-02-02 16:05:56 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
cellSet(c,w,h,x,y,cell);
|
2020-02-03 11:12:54 +01:00
|
|
|
|
2020-02-02 16:48:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (contents==PACKED_GOOMBA)
|
|
|
|
{
|
|
|
|
ennemi_t e=GOOMBA(8*x,8*y,-1);
|
|
|
|
ennemis[nombre_ennemis]=e;
|
|
|
|
nombre_ennemis++;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_KOOPA_VERT)
|
|
|
|
{
|
|
|
|
ennemi_t e=KOOPA_V(8*x,8*y,-1);
|
|
|
|
ennemis[nombre_ennemis]=e;
|
|
|
|
nombre_ennemis++;
|
|
|
|
}
|
|
|
|
else if (contents==PACKED_KOOPA_ROUGE)
|
|
|
|
{
|
|
|
|
ennemi_t e=KOOPA_R(8*x,8*y,-1);
|
|
|
|
ennemis[nombre_ennemis]=e;
|
|
|
|
nombre_ennemis++;
|
|
|
|
}
|
2020-03-07 15:22:39 +01:00
|
|
|
else if (contents==PACKED_PLANTE)
|
|
|
|
{
|
2020-03-10 19:20:06 +01:00
|
|
|
ennemi_t e=PLANTE(8*x+4,8*y-8);
|
2020-03-07 15:22:39 +01:00
|
|
|
ennemis[nombre_ennemis]=e;
|
|
|
|
nombre_ennemis++;
|
|
|
|
}
|
2020-02-02 17:55:03 +01:00
|
|
|
|
|
|
|
if (contents==PACKED_MARIO_START)
|
|
|
|
{
|
|
|
|
sx=8*x;
|
|
|
|
sy=8*y;
|
|
|
|
}
|
2020-02-01 16:39:34 +01:00
|
|
|
}
|
|
|
|
}
|
2020-02-02 16:05:56 +01:00
|
|
|
ll_sendp(LEVEL_INFO, "\n[i]Converted!\n[i]Sending to level zone...", w,h);
|
2020-02-16 20:43:35 +01:00
|
|
|
worldSet(w, h, sx, sy, c);
|
2020-02-02 16:05:56 +01:00
|
|
|
ll_sendp(LEVEL_INFO, "\n[i]Achieved unpacking", w,h);
|
2020-02-18 13:03:57 +01:00
|
|
|
|
|
|
|
// Don't free c, it will be automatically managed by the worldSet function
|
|
|
|
//freeProf(c);
|
2020-02-02 16:48:23 +01:00
|
|
|
|
|
|
|
|
2020-02-25 18:42:40 +01:00
|
|
|
ennemiesInit(ennemis, nombre_ennemis);
|
2020-02-02 16:05:56 +01:00
|
|
|
}
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
void setLevel(int w, int l)
|
2020-02-02 16:05:56 +01:00
|
|
|
{
|
2020-02-16 20:43:35 +01:00
|
|
|
levelNew();
|
|
|
|
teleportersSet(0,0);
|
|
|
|
worldSet(0,0,0,0,0);
|
2020-02-25 18:42:40 +01:00
|
|
|
ennemiesInit(0, 0);
|
2020-02-16 20:43:35 +01:00
|
|
|
platformsInit(0, 0);
|
2020-02-02 16:24:40 +01:00
|
|
|
|
2020-02-02 17:55:03 +01:00
|
|
|
if (w+1==1 && l+1==1) // 1-2
|
|
|
|
{
|
|
|
|
extern packed_level_t bin_lvl_1_1;
|
2020-02-16 20:43:35 +01:00
|
|
|
unpackLevel(&bin_lvl_1_1);
|
2020-02-02 17:55:03 +01:00
|
|
|
|
|
|
|
teleport_t t[]=
|
|
|
|
{
|
|
|
|
{57,6, 215,12, MK_DOWN},
|
|
|
|
{227,2, 179,3, MK_RIGHT}
|
|
|
|
};
|
2020-02-16 20:43:35 +01:00
|
|
|
teleportersSet(t, sizeof(t)/sizeof(teleport_t));
|
2020-02-02 17:55:03 +01:00
|
|
|
}
|
|
|
|
|
2020-02-02 16:24:40 +01:00
|
|
|
if (w+1==1 && l+1==2) // 1-2
|
|
|
|
{
|
|
|
|
extern packed_level_t bin_lvl_1_2;
|
2020-02-16 20:43:35 +01:00
|
|
|
unpackLevel(&bin_lvl_1_2);
|
2020-02-02 16:24:40 +01:00
|
|
|
|
|
|
|
teleport_t t[]=
|
|
|
|
{
|
|
|
|
{6,4, 21,12, MK_DOWN},
|
|
|
|
{106,5, 188,12, MK_DOWN},
|
|
|
|
{197,2, 118,4, MK_RIGHT},
|
|
|
|
{180,5, 206,2, MK_RIGHT},
|
|
|
|
};
|
2020-02-16 20:43:35 +01:00
|
|
|
teleportersSet(t, sizeof(t)/sizeof(teleport_t));
|
2020-02-02 16:24:40 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
plateform_t plateforme0[]=
|
2020-02-02 16:24:40 +01:00
|
|
|
{
|
2020-02-02 16:48:23 +01:00
|
|
|
PLATEFORME_MOVING_H(8*144,6*8+5,32,1,8*142,8*150)
|
2020-02-02 16:24:40 +01:00
|
|
|
};
|
2020-02-16 20:43:35 +01:00
|
|
|
platformsInit(plateforme0,sizeof(plateforme0)/sizeof(plateform_t));
|
2020-02-02 16:24:40 +01:00
|
|
|
}
|
2020-02-04 20:12:17 +01:00
|
|
|
|
|
|
|
if (w+1==1 && l+1==3) // 1-2
|
|
|
|
{
|
|
|
|
extern packed_level_t bin_lvl_1_3;
|
2020-02-16 20:43:35 +01:00
|
|
|
unpackLevel(&bin_lvl_1_3);
|
2020-02-04 20:12:17 +01:00
|
|
|
}
|
2020-04-03 14:43:45 +02:00
|
|
|
|
|
|
|
if (w+1==1 && l+1==4) // 1-2
|
|
|
|
{
|
|
|
|
extern packed_level_t bin_lvl_1_4;
|
|
|
|
unpackLevel(&bin_lvl_1_4);
|
|
|
|
}
|
2020-02-02 16:05:56 +01:00
|
|
|
}
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
void getLevelID(int w, int l, char * str)
|
2020-02-02 16:05:56 +01:00
|
|
|
{
|
|
|
|
str[3]='\0';
|
|
|
|
sprintf(str, "%d-%d", w+1, l+1);
|
2020-02-16 20:43:35 +01:00
|
|
|
}
|