Commit 1af757cd authored by Bruno Coudoin's avatar Bruno Coudoin

removed the gc_bonus_end_display in the C api and its

gcompris.board_finished python counterpart.
Now all activities stay at their last level when completed.
This is more adapted to the by activity distribution model
like we have for the olpc xo.

svn path=/branches/gcomprixogoo/; revision=3511
parent 89c3c40f
boards/skins/babytoy/bar_bg.png

3.75 KB | W: | H:

boards/skins/babytoy/bar_bg.png

2.24 KB | W: | H:

boards/skins/babytoy/bar_bg.png
boards/skins/babytoy/bar_bg.png
boards/skins/babytoy/bar_bg.png
boards/skins/babytoy/bar_bg.png
  • 2-up
  • Swipe
  • Onion skin
boards/skins/gartoon/bar_bg.png

4.08 KB | W: | H:

boards/skins/gartoon/bar_bg.png

2.62 KB | W: | H:

boards/skins/gartoon/bar_bg.png
boards/skins/gartoon/bar_bg.png
boards/skins/gartoon/bar_bg.png
boards/skins/gartoon/bar_bg.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -317,7 +317,7 @@ static void game_won() {
gcomprisBoard->level++;
gcomprisBoard->sublevel = 1;
if (gcomprisBoard->level > gcomprisBoard->maxlevel) {
gc_bonus_end_display(GC_BOARD_FINISHED_TUXLOCO);
gcomprisBoard->level = gcomprisBoard->maxlevel;
return;
}
......@@ -333,7 +333,6 @@ static void game_won() {
* =====================================================================*/
static gboolean ok_timeout()
{
g_warning("+++ ok_timeout errors = %d\n", errors);
gc_bonus_display(gamewon, GC_BONUS_SMILEY);
if (!gamewon)
errors--;
......@@ -342,7 +341,8 @@ static gboolean ok_timeout()
update_clock();
if (errors <= 1) {
gc_bonus_end_display(GC_BOARD_FINISHED_TOOMANYERRORS);
gamewon = TRUE;
gc_bonus_display(gamewon, GC_BOARD_LOOSE);
}
return FALSE;
......
......@@ -41,7 +41,6 @@ static gchar *op_div;
#define SOUNDLISTFILE PACKAGE
static gboolean board_paused = TRUE;
static int leavenow;
static int gamewon;
static void game_won(void);
......@@ -148,9 +147,6 @@ static void pause_board (gboolean pause)
if(gamewon == TRUE && pause == FALSE) /* the game is won */
algebra_next_level();
if(leavenow == TRUE && pause == FALSE)
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
board_paused = pause;
}
......@@ -231,7 +227,6 @@ static void start_board (GcomprisBoard *agcomprisBoard)
algebra_next_level();
gamewon = FALSE;
leavenow = FALSE;
pause_board(FALSE);
}
......@@ -387,7 +382,6 @@ is_our_board (GcomprisBoard *gcomprisBoard)
static void timer_end()
{
gamewon = FALSE;
leavenow = TRUE;
algebra_destroy_all_items();
gc_bonus_display(gamewon, GC_BONUS_SMILEY);
}
......@@ -877,10 +871,8 @@ static void game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gamewon = TRUE;
algebra_destroy_all_items();
......
......@@ -530,10 +530,9 @@ static void game_won() {
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) {
gc_bonus_end_display(GC_BOARD_FINISHED_TUXPLANE);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas),background_images[gcomprisBoard->level-1]);
}
algebra_guesscount_next_level();
......
......@@ -191,9 +191,7 @@ class Gcompris_algorithm:
self.gcomprisBoard.sublevel=1
self.gcomprisBoard.level += 1
if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel):
# the current board is finished : bail out
gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
return 0
self.gcomprisBoard.level = self.gcomprisBoard.maxlevel
self.display_current_level()
return 1
......
......@@ -567,16 +567,7 @@ game_won ()
gcomprisBoard->sublevel = 1;
gcomprisBoard->level++;
if (gcomprisBoard->level > gcomprisBoard->maxlevel)
{ // the
// current
// board
// is
// finished
// : bail
// out
gc_bonus_end_display (GC_BOARD_FINISHED_RANDOM);
return;
}
gcomprisBoard->level = gcomprisBoard->maxlevel;
}
}
......
......@@ -150,8 +150,7 @@ class Gcompris_bargame:
if sublevel > self.gcomprisBoard.number_of_sublevel:
if self.game_won:
if self.gcomprisBoard.level == self.gcomprisBoard.maxlevel:
gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
return 0
self.set_level(self.gcomprisBoard.level)
else:
self.set_level(self.gcomprisBoard.level+1)
else:
......
......@@ -257,10 +257,9 @@ static void game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
minigolf_next_level();
......
......@@ -46,27 +46,8 @@ py_gc_bonus_display(PyObject* self, PyObject* args)
}
/* void gc_bonus_end_display(int type); */
static PyObject*
py_gcompris_gc_bonus_end_display(PyObject* self, PyObject* args)
{
int type;
/* Parse arguments */
if(!PyArg_ParseTuple(args, "i:gc_bonus_end_display", &type))
return NULL;
/* Call the corresponding C function */
gc_bonus_end_display(type);
/* Create and return the result */
Py_INCREF(Py_None);
return Py_None;
}
static PyMethodDef PythonGcomprisBonusModule[] = {
{ "display", py_gc_bonus_display, METH_VARARGS, "gc_bonus_display" },
{ "board_finished", py_gcompris_gc_bonus_end_display, METH_VARARGS, "gc_bonus_end_display" },
{ NULL, NULL, 0, NULL}
};
......@@ -86,12 +67,6 @@ void python_gcompris_bonus_module_init(void)
PyModule_AddIntConstant(module, "GNU", GC_BONUS_GNU );
PyModule_AddIntConstant(module, "GNU", GC_BONUS_LION );
/* BonusFinishedList constants */
PyModule_AddIntConstant(module, "FINISHED_RANDOM", GC_BOARD_FINISHED_RANDOM );
PyModule_AddIntConstant(module, "FINISHED_TUXPLANE", GC_BOARD_FINISHED_TUXPLANE );
PyModule_AddIntConstant(module, "FINISHED_TUXLOCO", GC_BOARD_FINISHED_TUXLOCO );
PyModule_AddIntConstant(module, "FINISHED_TOOMANYERRORS", GC_BOARD_FINISHED_TOOMANYERRORS );
/* GCBonusStatusList constants */
PyModule_AddIntConstant(module, "LOOSE", GC_BOARD_LOOSE );
PyModule_AddIntConstant(module, "WIN", GC_BOARD_WIN );
......
......@@ -428,10 +428,9 @@ static void game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
canal_lock_next_level();
......
......@@ -611,10 +611,9 @@ static void game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
chess_next_level();
......
......@@ -447,10 +447,8 @@ static void game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_TUXPLANE);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
}
click_on_letter_next_level();
}
......
......@@ -795,10 +795,9 @@ static void game_won()
/* Try the next level */
gcomprisBoard->sublevel=0;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
clickgame_next_level();
......
......@@ -616,10 +616,9 @@ static void game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
clockgame_next_level();
......
......@@ -410,7 +410,8 @@ static void game_won()
if( g_list_length(listColors) <= 0 )
{ // the current board is finished : restart it
gc_bonus_end_display(GC_BOARD_FINISHED_TUXLOCO);
gamewon = TRUE;
gc_bonus_display(gamewon, GC_BONUS_GNU);
return;
}
......
......@@ -381,13 +381,6 @@ static void bonus() {
timer_id = 0;
}
// Display a 'end of game' animation
static void finished() {
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
timer_id = 0;
}
// One more level completed
static void game_won() {
......@@ -398,10 +391,8 @@ static void game_won() {
gcomprisBoard->sublevel = 1;
gcomprisBoard->level++;
if (gcomprisBoard->level>gcomprisBoard->maxlevel) { // all levels completed : the current board is finished
timer_id = g_timeout_add (2000, (GtkFunction) finished, NULL);
return;
}
if (gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
}
crane_next_level();
}
......
......@@ -215,8 +215,7 @@ class Gcompris_drawnumber :
def next_level(self) :
if self.gcomprisBoard.sublevel==self.gcomprisBoard.number_of_sublevel :
if (self.gcomprisBoard.level+1)>self.gcomprisBoard.maxlevel :
self.end()
gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
self.set_level((self.gcomprisBoard.level))
else :
self.set_level((self.gcomprisBoard.level+1))
else :
......
......@@ -169,9 +169,7 @@ class Gcompris_electric:
gcompris.bar_set_level(self.gcomprisBoard)
if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel):
# the current board is finished : bail out
gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
return 0
self.gcomprisBoard.level = self.gcomprisBoard.maxlevel
return 1
......
......@@ -499,10 +499,9 @@ static void game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
enumerate_next_level();
......
......@@ -429,11 +429,6 @@ static void bonus() {
timer_id = 0;
}
static void finished() {
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
timer_id = 0;
}
/* ==================================== */
static void
game_won()
......@@ -444,11 +439,10 @@ game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
/* the current board is finished : bail out */
if(gcomprisBoard->level>gcomprisBoard->maxlevel) {
timer_id = gtk_timeout_add (2000, (GtkFunction) finished, NULL);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
erase_next_level();
......
......@@ -293,10 +293,9 @@ static void game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
fifteen_next_level();
......
......@@ -22,22 +22,13 @@
#include <ctype.h>
#include <math.h>
#define SOUNDLISTFILE PACKAGE
#define GC_BONUS_DURATION 2000
#define TUX_TIME_STEP 300
static GooCanvasItem *bonus_group = NULL;
static GooCanvasItem *door1_item = NULL;
static GooCanvasItem *door2_item = NULL;
static GooCanvasItem *tuxplane_item = NULL;
static gboolean gc_bonus_end_display_running = FALSE;
static gboolean bonus_display_running = FALSE;
static gint end_bonus_id = 0, gc_bonus_end_display_id = 0;
//static gint end_board_count = 0;
static int left_door_limit = 0;
static gint end_bonus_id = 0;
// List of sounds to use for greetings
static gchar *greetingsList[] =
......@@ -67,132 +58,6 @@ static gchar *loosingList[] =
static void bonus_image(char *,GCBonusStatusList);
static void end_bonus(void);
/* ==================================== */
static void
end_gc_bonus_end_display() {
GooCanvasBounds bounds;
//end_board_count++;
goo_canvas_item_get_bounds(tuxplane_item, &bounds);
// animates tuxplane
if (/*end_board_count*/ bounds.x2 +50.0 < (double) (left_door_limit)) {
goo_canvas_item_translate(tuxplane_item, 50, 0);
return;
}
if (gc_bonus_end_display_id) {
g_source_remove(gc_bonus_end_display_id);
gc_bonus_end_display_id = 0;
}
if(door1_item)
goo_canvas_item_remove(door1_item);
if(door2_item)
goo_canvas_item_remove(door2_item);
if(tuxplane_item)
goo_canvas_item_remove(tuxplane_item);
door1_item = NULL;
door2_item = NULL;
tuxplane_item = NULL;
gc_bonus_end_display_running = FALSE;
gc_bar_hide(FALSE);
// go back to the first level
GcomprisBoard *gcomprisBoard = gc_board_get_current();
gcomprisBoard->level = 1;
gcomprisBoard->sublevel = 0;
/* Re-Start the board */
gc_board_pause(FALSE);
}
/* ==================================== */
#define OFFSET 100
void
gc_bonus_end_display(GCBoardFinishedList type) {
GcomprisBoard *gcomprisBoard = gc_board_get_current();
int x,y;
GdkPixbuf *pixmap_door1 = NULL,*pixmap_door2 = NULL,*pixmap_tuxplane = NULL;
char * str = NULL;
g_assert(type < GC_BOARD_FINISHED_LAST);
gc_bar_hide(TRUE);
if (gc_bonus_end_display_running)
return;
else
gc_bonus_end_display_running = TRUE;
/* First pause the board */
gc_board_pause(TRUE);
/* WARNING: I remove 1 to the GC_BOARD_FINISHED_LAST because RANDOM is for GOOD end only */
if(type==GC_BOARD_FINISHED_RANDOM)
type = RAND(1,GC_BOARD_FINISHED_LAST-2);
/* Record the end of board */
gc_log_end (gcomprisBoard, GC_BOARD_COMPLETED);
switch (type) {
case GC_BOARD_FINISHED_TUXPLANE :
str = g_strdup_printf("tuxplane.png");
break;
case GC_BOARD_FINISHED_TUXLOCO :
str = g_strdup_printf("tuxloco.png");
break;
case GC_BOARD_FINISHED_TOOMANYERRORS :
str = g_strdup_printf("toomanyerrors.png");
break;
default :
str = g_strdup_printf("tuxplane.png");
break;
}
pixmap_door1 = gc_skin_pixmap_load("door1.png");
pixmap_door2 = gc_skin_pixmap_load("door2.png");
pixmap_tuxplane = gc_skin_pixmap_load(str);
g_free(str);
g_assert(gcomprisBoard != NULL);
x = BOARDWIDTH - OFFSET - gdk_pixbuf_get_width(pixmap_door1);
y = OFFSET;
left_door_limit = x + gdk_pixbuf_get_width(pixmap_door1);
door1_item = goo_canvas_image_new (goo_canvas_get_root_item(GOO_CANVAS(gcomprisBoard->canvas)),
pixmap_door1,
x,
y,
NULL);
x = OFFSET;
y = (BOARDHEIGHT - gdk_pixbuf_get_height(pixmap_tuxplane)) /2;
tuxplane_item = goo_canvas_image_new (goo_canvas_get_root_item(GOO_CANVAS(gcomprisBoard->canvas)),
pixmap_tuxplane,
x,
y,
NULL);
x = BOARDWIDTH - OFFSET - gdk_pixbuf_get_width(pixmap_door2);
y = OFFSET;
door2_item = goo_canvas_image_new (goo_canvas_get_root_item(GOO_CANVAS(gcomprisBoard->canvas)),
pixmap_door2,
x,
y,
NULL);
gdk_pixbuf_unref(pixmap_door1);
gdk_pixbuf_unref(pixmap_door2);
gdk_pixbuf_unref(pixmap_tuxplane);
gc_bonus_end_display_id = g_timeout_add (TUX_TIME_STEP, (GtkFunction) end_gc_bonus_end_display, NULL);
}
/* ==================================== */
void
gc_bonus_display(GCBonusStatusList gamewon, GCBonusList bonus_id)
......
......@@ -20,8 +20,8 @@
#define BONUS_H
/* The time, in ms, between the click of the player, making a choice
* and the moment the bonus appears. Only used when there is no thumb
* in the board */
* and the moment the bonus appears.
*/
#define TIME_CLICK_TO_BONUS 800
/* BONUS_LAST is equals to the last available bonus type */
......@@ -37,15 +37,6 @@ typedef enum
GC_BONUS_LAST
} GCBonusList;
typedef enum
{
GC_BOARD_FINISHED_RANDOM,
GC_BOARD_FINISHED_TUXPLANE,
GC_BOARD_FINISHED_TUXLOCO,
GC_BOARD_FINISHED_TOOMANYERRORS,
GC_BOARD_FINISHED_LAST
} GCBoardFinishedList;
typedef enum
{
GC_BOARD_LOOSE,
......@@ -59,6 +50,5 @@ typedef enum
* ----------------------
*/
void gc_bonus_display(GCBonusStatusList, GCBonusList);
void gc_bonus_end_display(GCBoardFinishedList);
#endif
......@@ -707,11 +707,8 @@ static void player_win(GooCanvasItem *item)
{
/* Try the next level */
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_score_end();
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gamewon = TRUE;
gletters_destroy_all_items();
......
......@@ -573,10 +573,9 @@ game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
hanoi_next_level();
......
......@@ -396,10 +396,9 @@ static void game_won()
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
hanoi_next_level();
......
......@@ -397,10 +397,8 @@ static void game_won()
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
{
gc_bonus_end_display(GC_BOARD_FINISHED_TUXLOCO);
return;
}
gcomprisBoard->level = gcomprisBoard->maxlevel;
imageid_next_level();
}
else
......
......@@ -338,10 +338,8 @@ static void game_won() {
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_TUXLOCO);
return;
}
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
}
leftright_next_level();
}
......
......@@ -419,13 +419,6 @@ static GooCanvasItem *magic_hat_create_item()
return NULL;
}
// Display a 'end of game' animation
static void finished() {
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
timer_id = 0;
}
// One more level completed
static void game_won() {
......@@ -436,10 +429,9 @@ static void game_won() {
gcomprisBoard->sublevel = 1;
gcomprisBoard->level++;
if (gcomprisBoard->level>gcomprisBoard->maxlevel) { // all levels completed : the current board is finished
timer_id = g_timeout_add (2000, (GtkFunction) finished, NULL);
return;
}
if (gcomprisBoard->level>gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
}
magic_hat_next_level();
}
......
......@@ -529,10 +529,9 @@ static void game_won() {
twoDdisplay();
/* Try the next level */
gcomprisBoard->level++;
if(gcomprisBoard->level > gcomprisBoard->maxlevel) { // the current board is finished : bail out
gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
return;
}
if(gcomprisBoard->level > gcomprisBoard->maxlevel)
gcomprisBoard->level = gcomprisBoard->maxlevel;
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
maze_next_level();
......
......@@ -327,9 +327,7 @@ class Gcompris_melody:
self.gcomprisBoard.sublevel=1
self.gcomprisBoard.level += 1
if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel):
# the current board is finished : bail out
gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
return 0
self.gcomprisBoard.level = self.gcomprisBoard.maxlevel
return 1
......
......@@ -1367,10 +1367,9 @@ static void player_win()
/* Try the next level */
if (tux_pairs <= player_pairs)
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out