void restart()
{
	removeAllTimers();
	isNewGame = true;
	isNewGame = 1;
	initGameScreen();
}
int c_video_restart(lua_State *L) {
	initGameScreen();
	shutdownDisplay( gScreen );
	setupDisplay( gScreen );
	updateCallbacks();
	changeDisplay(-1);
	return 0;
}
Exemplo n.º 3
0
void reshape(int x, int y) {
  if(x < game->settings->height || x < game->settings->width)
    initGameScreen();
  if(x > game->settings->width )
    game->screen->vp_x = (x - game->settings->width) / 2;
  if(y > game->settings->height )
    game->screen->vp_y = (y - game->settings->height) / 2;
  changeDisplay();
}
Exemplo n.º 4
0
void reshape(int x, int y) {
    if(x < getSettingi("height") || x < getSettingi("width"))
        initGameScreen();
    if(x > getSettingi("width") )
        gScreen->vp_x = (x - getSettingi("width")) / 2;
    if(y > getSettingi("height") )
        gScreen->vp_y = (y - getSettingi("height")) / 2;
    changeDisplay(-1);
}
Exemplo n.º 5
0
void startGame() {
  register uchar x,y;

  selX = -1;
  score = 0;
  gameOver = 0;

  
  initGameScreen();
//  drawScore1();

  for(y=0; y!=GAME_HEIGHT; ++y)
    for(x=0; x!=GAME_WIDTH; ++x)
      game[x][y] = 0;
 
  randNewBall();
  gameStep();
}
int main()
{
	initTimers();
	initVideo();
	sound_initAC97();
	mouse_init();
	initInterrupts();
	isNewGame = true;
	initGameScreen();

	PIT_startRecurringTimer(XPAR_PIT_0_BASEADDR, CLOCK_FREQ_HZ / INTERRUPTS_PER_SECOND);

	while(1) // Program never ends.
		if(low_priority_intc_status != 0)
			lowPriorityInterruptHandler();

	cleanup_platform();
	return 0;
}
Exemplo n.º 7
0
void AssassinWar::initMainWin()
{
    setWindowFlags(Qt::FramelessWindowHint);

    initGameScreen();

    initToolbarManager();

    initGameSettingDlg();

    initJoinGameDlg();

    initToolbar();

    initRepainter();

    initBackground(BACKGROUND_IMG);

    showMainWin();
}
Exemplo n.º 8
0
void main() {
  uchar c, c1;
  uchar selAnimationT = 0;
  uint selAnimationTT = 0, keybTimeout=0; 

  intro();
    
  // Инициализируем экран
  initGameScreen();

  // Запускаем игру
  startGame();

  while(1) {
    rand();

    if(selX!=-1) {
      selAnimationTT++;
      if(selAnimationTT==500) {
        selAnimationTT=0;
        drawSpriteSel(selX, selY, game[selX][selY], selX==cursorX && selY==cursorY, selAnimationT);
        selAnimationT++;
        if(selAnimationT>=4) selAnimationT=0; else
        if(playSound && selAnimationT==2) soundJumpSel();
      }
    }

    c1 = bioskey_();

    if(keybTimeout) {
      keybTimeout--;
      continue;
    }
    
    if(c == c1) continue;
    c = c1;

    switch(c) {
      case KEY_PATH:       showPath  = !showPath;  drawOnOff(0, showPath);  break;
      case KEY_SOUND:      playSound = !playSound; drawOnOff(1, playSound); break;
      case KEY_HELP:       showHelp  = !showHelp;  drawOnOff(2, showHelp);  redrawNewBalls2(); break;
      case KEY_RECORD:
        prepareRecordScreen();
        drawRecordScreen(-1);
        getch_();
        drawCells();
        break;
      case KEY_NEW:        startGame(); break;
/*      case KEY_UP:
        if(score>=10)
          score-=10;
        drawScore1();
        break;
      case KEY_DOWN:
        score+=10;
        drawScore1();
        break; */
      case KEY_UP:    clearCursor(); if(cursorY==0) cursorY=8; else cursorY--; drawCursor(); break;
      case KEY_DOWN:  clearCursor(); if(cursorY==8) cursorY=0; else cursorY++; drawCursor(); break;
      case KEY_LEFT:  clearCursor(); if(cursorX==0) cursorX=8; else cursorX--; drawCursor(); break;
      case KEY_RIGHT: clearCursor(); if(cursorX==8) cursorX=0; else cursorX++; drawCursor(); break;
      case KEY_SPACE: 
        if(game[cursorX][cursorY]) { if(selX!=-1) drawCell(selX, selY); selX=cursorX, selY=cursorY; break; }
        if(selX==-1) break;
        move();
        if(gameOver) {
          recordAnimation();
          startGame();
        }
        break;        
      default:
        continue;
    }

    keybTimeout=300;
  }
}