void highscore_show_ext(int numb, int back, int show, int newcol, int othercol, std::string name, int size) {
    enigma::highscore_background=back;
    enigma::highscore_border=show;
    enigma::highscore_new_entry_color=newcol;
    enigma::highscore_other_entries_color=othercol;

    highscore_show(numb);
}
Exemplo n.º 2
0
static void game_init(void)
{
    int selection = 0;

    static const struct opt_items type_options[] = {
        { "Type A", -1 },
        { "Type B", -1 },
    };

    MENUITEM_STRINGLIST(menu, "Snake2 Menu", NULL,
                        "Start New Game",
                        "Game Type", "Select Maze", "Speed",
                        "High Scores",
                        "Playback Control", "Quit");

    rb->button_clear_queue();

    dead = 0;
    apple = 0;
    score = 0;
    applecount = 0;

    while (1) {
        switch (rb->do_menu(&menu, &selection, NULL, false)) {
            case 0:
                speed = level*20;
                return;
            case 1:
                rb->set_option("Game Type", &game_type, INT,
                               type_options, 2, NULL);
                break;
            case 2:
                select_maze();
                if(quit) return;
                break;
            case 3:
                rb->set_int("Speed", "", UNIT_INT, &level,
                            NULL, 1, 1, 10, NULL);
                break;
            case 4:
                highscore_show(-1, highscores, NUM_SCORES, true);
                break;
            case 5:
                playback_control(NULL);
                break;
            case 6:
                quit = 1;
                return;
            case MENU_ATTACHED_USB:
                quit = 2;
                return;
            default:
                break;
        }
    }
}
Exemplo n.º 3
0
static int clix_menu(struct clix_game_state_t* state, bool ingame)
{
    rb->button_clear_queue();
    int choice = 0;
    bool leave_menu=false;
    int ret=0;

    _ingame = ingame;

    MENUITEM_STRINGLIST (main_menu, "Clix Menu", clix_menu_cb,
                             "Resume Game",
                             "Start New Game",
                             "Help",
                             "High Scores",
                             "Playback Control",
                             "Quit");

    while (!leave_menu) {

        switch (rb->do_menu(&main_menu, &choice, NULL, false)) {
            case 0:
                leave_menu=true;
                ret = 0;
                break;
            case 1:
                clix_init(state);
                leave_menu=true;
                ret = 0;
                break;
            case 2:
                if (clix_help()) {
                    leave_menu=true;
                    ret = 1;
                }
                break;
            case 3:
                highscore_show(-1, highscores, NUM_SCORES, true);
                break;
            case 4:
                playback_control(NULL);
                break;
            case 5:
            case MENU_ATTACHED_USB:
                leave_menu=true;
                ret = 1;
                break;
            default:
                break;
        }
    }

    return ret;
}
Exemplo n.º 4
0
enum plugin_status plugin_start (const void *parameter)
{

    (void) parameter;

    rb->srand (*rb->current_tick);

    /* Load HighScore if any */
    highscore_load(SCORE_FILE, highscores, NUM_SCORES);

#if LCD_DEPTH > 1
    rb->lcd_set_backdrop(NULL);
#endif

#ifdef HAVE_LCD_BITMAP
    rb->lcd_setfont (FONT_SYSFIXED);
#else
    if (!pgfx_init(4, 2))
    {
        rb->splash(HZ*2, "Old LCD :(");
        return PLUGIN_OK;
    }
#endif
    /* Turn off backlight timeout */
    backlight_ignore_timeout();
    load_game();
    resume_file = resume;
    while(!rockblox_loop()) {
        if(!resume) {
            int position = highscore_update(rockblox_status.score,
                                            rockblox_status.level, "",
                                            highscores, NUM_SCORES);
            if (position != -1) {
                if (position == 0)
                    rb->splash(HZ*2, "New High Score");
                highscore_show(position, highscores, NUM_SCORES, true);
            }
        }
    }

#ifndef HAVE_LCD_BITMAP
    pgfx_release();
#endif
    /* Save user's HighScore */
    highscore_save(SCORE_FILE, highscores, NUM_SCORES);
    backlight_use_settings();

    return PLUGIN_OK;
}
Exemplo n.º 5
0
static int rockblox_menu(void)
{
    int selected = 0;

    MENUITEM_STRINGLIST(main_menu, "Rockblox Menu", rockblox_menu_cb,
                        "Resume Game", "Start New Game",
                        "Help", "High Scores", "Playback Control",
                        "Quit without Saving", "Quit");

    rb->button_clear_queue();
    while (true) {
        switch (rb->do_menu(&main_menu, &selected, NULL, false)) {
            case 0:
                if(resume_file)
                    rb->remove(RESUME_FILE);
                init_rockblox(true);
                return 0;
            case 1:
                init_rockblox(false);
                return 0;
            case 2:
                if (rockblox_help())
                    return 1;
                break;
            case 3:
                highscore_show(-1, highscores, NUM_SCORES, true);
                break;
            case 4:
                if (playback_control(NULL))
                    return 1;
                break;
            case 5:
                return 1;
            case 6:
                if (resume) {
                    rb->splash(HZ*1, "Saving game ...");
                    dump_resume();
                }
                return 1;
            case MENU_ATTACHED_USB:
                return 1;
            default:
                return 1;
                break;
        }
    }
}
Exemplo n.º 6
0
static int clix_click(struct clix_game_state_t* state)
{
    int position;
    if (state->selected_count <= 1) {
        return 0;
    }
    switch( clix_clear_selected( state))
    {
        case CLIX_CLEARED:
            state->score += state->level * 100;
            clix_draw( state);
            if (state->level < NUM_LEVELS) {
                rb->splash(HZ*2, "Great! Next Level!");
                state->level++;
                clix_init_new_level( state);
                clix_update_selected( state);
            }
            else {
                rb->splash(HZ*2, "Congratulation!!!");
                rb->splash(HZ*2, "You have finished the game.");
                if(clix_menu(state, 0))
                    return 1;
            }
        break;
        case CLIX_GAMEOVER:
            clix_draw( state);
            rb->splash(HZ*2, "Game Over!");
            rb->lcd_clear_display();
            position = highscore_update(state->score, state->level, "",
                                        highscores, NUM_SCORES);
            if (position != -1)
            {
                if (position == 0)
                    rb->splash(HZ*2, "New High Score");
                highscore_show(position, highscores, NUM_SCORES, true);
            }
            if(clix_menu(state, 0))
                return 1;
        break;
        default:
            rb->sleep(10);  /* prevent repeating clicks */
        break;
    }
    return 0;
}
Exemplo n.º 7
0
static int snake_game_menu(void)
{
    MENUITEM_STRINGLIST(main_menu,"Snake Menu",snake_menu_cb,
                        "Resume Game",
                        "Start New Game",
                        "Snake Speed",
                        "High Score",
                        "Playback Control",
                        "Quit");
    int selected = 0;

    rb->button_clear_queue();

    while (true) {
        switch (rb->do_menu(&main_menu, &selected, NULL, false)) {
            case 0:
                snake_redraw();
                return 0;
            case 1:
                snake_game_init();
                return 0;
            case 2:
                rb->set_int("Snake Speed", "", UNIT_INT, &level,
                            NULL, 1, 1, 9, NULL);
                break;
            case 3:
                highscore_show(-1, highscores, NUM_SCORES, true);
                rb->lcd_setfont(FONT_UI);
                break;
            case 4:
                playback_control(NULL);
                break;
            case 5:
                return 1;
            case MENU_ATTACHED_USB:
                return 1;
            default:
                break;
        }
    }
}
void action_highscore_show(int background,int border,double newColor,double otherColor,std::string font,int a,int b,int c,int d,int e,int f) {
    highscore_show(score);
}