GSoC/GCI Archive
Google Code-in 2014 KDE

Marble: Ask user the number of questions he/she wants to attempt at the beginning of the game "Identify The Flag"

completed by: Daniel Pastushchak

mentors: Dennis Nienhüser, Abhinav Gangwar, shentey, Torsten Rahn

See "County By Shape" game. It asks user at the beginning about how many questions he wants to attempt.
Your task is to add the same feature in "Identify the flag" game. Follow the steps below.

1. In file GameOptions.qml , you need to first switch to "QUESTION_COUNT_QUERY" state before you enable "GAMES_VIEW_VISIBLE" state ( See CustomButton showing the Country By Flag game there ). For example see that I have done the same for "Country By Shape" game there commenting out the old code - grab an idea from this example.

2. After that you need to define a variable maximumQuestions in CountryByFlag.qml( just like I have done in CountryByShape.qml ) which will hold the number of questions user opted to answer.

3. Then define a function "setMaximumQuestions( questionsCount )" , in CountryByFlag.qml, which will assign the value of questionsCount to the variable 'maximumQuestions' . Again, see CountryByShape.qml for help.

4. The next step would be to modify function "setQuestion(...)" in CountryByFlag.qml so that the game asks exactly the same number of questions as user has opted to answer in the beginning of game.

PS : You can find all the concerned files in directory examples/cpp/marble-game/ .