Пример #1
0
// entry point of the program
int main( int arc, char* argv[] )
{	
	// First we need to create our Game Framework
	Initialise(SCREEN_X, SCREEN_Y, false,"Shoot em up" );

	initGame();
	initMenu();
	initBoss();
	initGameOver();
	gameProcess = &menuState;	
	do {
		frameCounter++;

		if(frameCounter > 5000)
			frameCounter = 0;
		
		gameProcess();	// function pointer to run game
		
	} while ( FrameworkUpdate() == false );
	// clean up memory
	destroyGame();
	destroyMenu();
	destroyBoss();
	destroyGameOver();
	
	Shutdown();

	return 0;
}
Пример #2
0
OrcBoss* OrcBoss::createBoss(int wallNode, Node *parent) {
	auto boss = new OrcBoss();
	if (boss && boss->initBoss(wallNode, parent)) {
		boss->autorelease();
		return boss;
	}
	CC_SAFE_DELETE(boss);
	return nullptr;
}
Пример #3
0
void initTitle() {
  int stg;
  status = TITLE;

  stg = initTitleAtr();
  initBoss();
  initShip();
  initLasers();
  initFrags();
  initShots();
  initBackground(0);
  initTitleStage(stg);
  left = -1;
}
Пример #4
0
void initGame(int stg) {
  int sn;
  status = IN_GAME;

  initBoss();
  initFoes();
  initShip();
  initLasers();
  initFrags();
  initShots();

  initGameState(stg);
  sn = stg%SAME_RANK_STAGE_NUM;
  initBackground(sn);
  if ( sn == SAME_RANK_STAGE_NUM-1 ) {
    playMusic(rand()%(SAME_RANK_STAGE_NUM-1));
  } else {
    playMusic(sn);
  }
}