bool flyBird() { //printf("Pro%f\n",projection_angle * (180.0f/M_PI)); //printf("Fly%d\n", bird_can_fly); //printf("onCannon%d\n", bird_on_cannon); if (bird_can_fly && !bird_on_cannon && !is_outside_screen()) { fly_time += 0.02; change_velcities(); bird_center_x += velocity_x; bird_center_y += velocity_y; } else if (is_outside_screen()) { bird_on_cannon = false; } }
static int hiscore_congrats(const char **menu) { char name[8] = " "; int x = 9; int y = _HEIGHT_24L ? 7 : 3; setwcurs(0, 9, y); while (is_outside_screen(x+26, 0)) x--; drawbox(x, y, 26, 9, "CONGRATULATIONS!"); setcurs(x+2, y+2); printstr("You have a highscore!"); newln(x+2); printstr("Please enter your name"); entername: switch (hiscore_entername_menu(name, menu, x+4, y+4)) { case 0: return 0; case 1: if (savehiscore(name)) { if (x > 7) clearbox(33, y, 2, 9); return hiscorebox(menu, 9, y); } setcurs(x+2, y+2); printstr("ERROR! Could not save"); newln(x+2); printstr("score to file. "); goto entername; case 2: clearbox(32, y, 0, 9); return 1; } }
int dropdownlist(const char **items, int n, int i, int x, int y) { int w = getdropdownwidth(items, n); int j; while (is_outside_screen(0, y+n+1)) y--; setattr_standout(); drawbox(x, y, w+2, n+2, NULL); x++; y++; setcurs(x, y); for (j = 0; j < n; j++) { printdropdownitem(items[j], i==j, w); newln(x); } while (1) { setcurs(x-1, y+i); refreshwin(-1); switch (getkeypress_block(SINGLE_PL) & 0xFF) { case STARTBTN: case A_BTN: goto out; case 'q': exit(0); case MVUP: if (!i) continue; j = -1; break; case '\t': if (i == n-1) { j = -i; break; } case MVDOWN: if (i < n-1) { j = 1; break; } case MVRIGHT: continue; default: i = -1; goto out; } setcurs(x, y+i); printdropdownitem(items[i], 0, w); i += j; setcurs(x, y+i); printdropdownitem(items[i], 1, w); } out: clearbox(x-1, y-1, w+2, n+2); return i+1; }
int draw_vline(int x, int y, int h) { if (is_outside_screen(x+1, 0)) return 0; movefwd(x); while (--h) { putch(VLINE); newln(x); } putch(VLINE); return 1; }
void draw_tetris_logo(int x, int y) { int bl; drawbl(0x227, 1, x, y); drawbl(0x313, 4, x+7, y); drawbl(1, 4, x+8, y+1); drawbl(0x227, 6, x+12, y); drawbl(0x113, 7, x+19, y); drawbl(0x111, 2, x+24, y); bl = 0x326; if (is_outside_screen(x+33, 0)) bl = 0x322; drawbl(bl, 3, x+27, y); setattr_normal(); }
static int hiscorebox(const char **menu, int x, int y) { int i = 0; while (i < 10 && hiscores[i].score >= player1.score) i++; if (i < 10) i++; while (is_outside_screen(x+24, 0)) x--; drawbox(x, y, 24, 11, "HIGHSCORES"); x += 2; show_hiscorelist5(x, y+2, i); exit(0); //WILLIAMICED if (playagain_menu(menu, x+2, y+8)) { clearbox(x+21, y, 0, 11); return 1; } return 0; }