fix an infinite loop bug when a level is not coded yet

dev
Milang 3 years ago
parent ef4d0ffcdf
commit a071d0373e
  1. BIN
      SuperCbr.g1a
  2. BIN
      build-fx/SuperCbr.bin
  3. BIN
      build-fx/SuperCbr.elf
  4. 936
      build-fx/map
  5. BIN
      build-fx/src/level.c.o
  6. BIN
      build-fx/src/levelchanger.c.o
  7. 4
      build-fx/src/tuyau.c.d
  8. BIN
      build-fx/src/tuyau.c.o
  9. 3
      src/level.c
  10. 39
      src/levelchanger.c
  11. 2
      src/tuyau.c

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

@ -1,5 +1,5 @@
build-fx/src/tuyau.c.o: src/tuyau.c include/tuyau.h include/mario.h \
include/box.h include/keyboard.h
include/box.h include/keyboard.h include/world.h
include/tuyau.h:
@ -8,3 +8,5 @@ include/mario.h:
include/box.h:
include/keyboard.h:
include/world.h:

Binary file not shown.

@ -376,7 +376,8 @@ void set_level(int w, int l)
teleport_t t[]=
{
{57,6, 212,12, MK_LITTLE}
{57,6, 212,12, MK_LITTLE},
{222,2, 178,4, MK_RIGHT}
};
set_teleporteurs(t, sizeof(t)/sizeof(teleport_t));

@ -88,6 +88,17 @@ static void levelchanger(int w)
mario_immunity=0;
for (int i=0; i<7; i+=0)
{
extern image_t img_new_level;
dimage(0,0,&img_new_level);
char lvl[4];
get_lvl_id(w, i, lvl);
dtext(53,28, lvl, C_WHITE, C_BLACK);
sprintf(lvl, "%d", lifes);
dtext(65,54, lvl, C_WHITE, C_BLACK);
dupdate();
sleep_ms(3,2000);
int a=play_level(w, i);
if (a==0)
lifes--;
@ -109,6 +120,17 @@ static void levelchanger(int w)
}
else
{
extern image_t img_new_level;
dimage(0,0,&img_new_level);
char lvl[4];
get_lvl_id(w, choice, lvl);
dtext(53,28, lvl, C_WHITE, C_BLACK);
sprintf(lvl, "%d", lifes);
dtext(65,54, lvl, C_WHITE, C_BLACK);
dupdate();
sleep_ms(3,2000);
while (1)
{
new_game();
@ -234,20 +256,13 @@ int play_level(int w, int l)
//int finish_status=0; // FAil
finish_level=0; mario_dead=0;
set_level(w, l);
if (w_current==0)
return 0;
if (w_current_x*w_current_y==0)
{
timer_stop(0);
return -1;
}
reset_camera();
extern image_t img_new_level;
dimage(0,0,&img_new_level);
char lvl[4];
get_lvl_id(w, l, lvl);
dtext(53,28, lvl, C_WHITE, C_BLACK);
sprintf(lvl, "%d", lifes);
dtext(65,54, lvl, C_WHITE, C_BLACK);
dupdate();
sleep_ms(3,2000);
while(global_quit==0)

@ -1,6 +1,7 @@
#include <tuyau.h>
#include <mario.h>
#include <keyboard.h>
#include <world.h>
#include <gint/std/string.h>
@ -38,6 +39,7 @@ void teleport_active()
}
mario.p.x=t.tx*8; mario.p.y=t.ty*8;
mario.p.vx=0; mario.p.vy=0;
reset_camera();
}
}
}
Loading…
Cancel
Save