Esempio n. 1
0
int pauseGame(S_level *level) {
	SDL_Event event;
	int action = 0;
	int selection = 1;
	while (1) {
		drawPause(level, selection);
		SDL_WaitEvent(&event);
		switch(event.type){
			case SDL_KEYDOWN:
				if (event.key.keysym.sym == SDLK_UP) {
					selection--;
					if (selection < 1)
						selection = 2;
				}
				if (event.key.keysym.sym == SDLK_DOWN){
					selection++;
					if (selection > 2)
						selection = 1;
				}
				if (event.key.keysym.sym == SDLK_RETURN) {
					action = selection;
				}
				break;
			case SDL_QUIT:
				return 1;
		}
		if (action == 1)
			return 0;
		if (action == 2)
			return 1;
	}
	return 0;
}
Esempio n. 2
0
static void draw() {
  switch ( status ) {
  case TITLE:
    drawBackground();
    drawBoss();
    drawBulletsWake();
    drawBullets();
    startDrawBoards();
    drawSideBoards();
    drawTitle();
    endDrawBoards();
    break;
  case IN_GAME:
  case STAGE_CLEAR:
    drawBackground();
    drawBoss();
    drawLasers();
    drawShots();
    drawBulletsWake();
    drawFrags();
    drawShip();
    drawBullets();
    startDrawBoards();
    drawSideBoards();
    drawBossState();
    endDrawBoards();
    break;
  case GAMEOVER:
    drawBackground();
    drawBoss();
    drawBulletsWake();
    drawFrags();
    drawBullets();
    startDrawBoards();
    drawSideBoards();
    drawGameover();
    endDrawBoards();
    break;
  case PAUSE:
    drawBackground();
    drawBoss();
    drawLasers();
    drawShots();
    drawBulletsWake();
    drawFrags();
    drawShip();
    drawBullets();
    startDrawBoards();
    drawSideBoards();
    drawBossState();
    drawPause();
    endDrawBoards();
    break;
  }
}
Esempio n. 3
0
void displayPause() {
  drawGame();
  drawPause(game->screen);

  SystemSwapBuffers();
}
Esempio n. 4
0
void settings_draw() {
	al_clear_to_color(al_map_rgb(255,255,255));
	drawPause(false);
}
Esempio n. 5
0
static void draw() {
  switch ( status ) {
  case TITLE:
    // Draw background.
    drawBackground();
    drawFoes();
    drawBulletsWake();
    blendScreen();
    // Draw forground.
    drawBullets();
    drawScore();
    drawTitleMenu();
    break;
  case IN_GAME:
    // Draw background.
    drawBackground();
    drawBonuses();
    drawFoes();
    drawBulletsWake();
    drawFrags();
    blendScreen();
    // Draw forground.
    drawShots();
    drawShip();
    drawBullets();
    drawScore();
    break;
  case GAMEOVER:
    // Draw background.
    drawBackground();
    drawFoes();
    drawBulletsWake();
    drawFrags();
    blendScreen();
    // Draw forground.
    drawShots();
    drawBullets();
    drawScore();
    drawGameover();
    break;
  case STAGE_CLEAR:
    // Draw background.
    drawBackground();
    drawBonuses();
    drawFrags();
    blendScreen();
    // Draw forground.
    drawShots();
    drawShip();
    drawScore();
    drawStageClear();
    break;
  case PAUSE:
    // Draw background.
    drawBackground();
    drawBonuses();
    drawFoes();
    drawBulletsWake();
    drawFrags();
    blendScreen();
    // Draw forground.
    drawShots();
    drawShip();
    drawBullets();
    drawScore();
    drawPause();
    break;
  }
}