예제 #1
0
파일: main.cpp 프로젝트: rosen90/GitHub
void logicButtons(bool temp[]) {
	for (int i = 0; i < NUMBER_OF_BUTTON; ++i) {
		if (temp[i] == true) {
			switch (i) {
			case 0:
			    if(!lockButtons)
                {
                    startStopGame();
                }
				temp[i] = false;
				break;
			case 1:
			    if(!lockButtons)
                {
                    setToDefault();
                    loadGame(board);
                    if(availableMatches() == 0)
                    {
                        startStopGame();
                    }
                }
				temp[i] = false;
				break;
			case 2:
				showHelp();
				temp[i] = false;
				break;
			case 3:
				startStopSound();
				temp[i] = false;
				break;
			}
		}
	}
}
예제 #2
0
void logicButtons(bool temp[])
{
    for (int i = 0; i < NUMBER_OF_BUTTON; ++i)
    {
        if (temp[i] == true)
        {
            switch (i)
            {
            case 0:
                printf("start function \n");
                startStopTimer();
                startStopGame();
                temp[i] = false;
                break;
            case 1:
                printf("save function \n");
                temp[i] = false;
                break;
            case 2:
                printf("load function \n");
                temp[i] = false;
                break;
            case 3:
                printf("help function \n");
                showHelp();
                temp[i] = false;
                break;
            }
        }
    }
}
void GameApplication::logicButtons(bool temp[]) {
	for (int i = 0; i < NUMBER_OF_BUTTON; ++i) {
		if (temp[i] == true) {
			switch (i) {
			case 0:
				if (!lockButtons) {
					startStopGame();
				}
				if (chunk) {
					Mix_PlayChannel(-1, click, 0);
				}
				temp[i] = false;
				break;
			case 1:
				if (!lockButtons) {
					setToDefault();
					loadGame(board);
					if (availableMatches() == 0) {
						startStopGame();
					}
				}
				if (chunk) {
					Mix_PlayChannel(-1, click, 0);
				}
				temp[i] = false;
				break;
			case 2:
				showHelp();
				if (chunk) {
					Mix_PlayChannel(-1, click, 0);
				}
				temp[i] = false;
				break;
			case 3:
				startStopSound();
				if (chunk) {
					Mix_PlayChannel(-1, click, 0);
				}
				temp[i] = false;
				break;
			}
		}
	}
}