Revision 684464

Go back to digest for 8th July 2007

Features in Games

Nicolas Roffet committed changes in /trunk/KDE/kdegames:

I added a new class in libkdegames: "KGameDifficulty".

In many games, the player can select and change the difficulty level. Until now, this is rewritten from scatch in every single game and it's not uniform. With KGameDifficulty, it should be easier and more consistant.

Features:
- The class uses the standard icon "games-difficult.png".
- It's possible to use between 1 and 8 "standard" appelations for the levels (like "Easy", "Medium", "Hard", ...) or to customize them (and have more) if needed.
- The class can ask the player to confirm, if he wants to start a new game to change the difficulty level, so that the game itself doesn't need to care much about this.
- It's possible to defined a custom difficulty level (with a configuration dialog that has to be implemented in every game).

The class is in a 1st draft state. It's working, but not yet full documented and wihout D-pointer yet.

We should also discuss if it's OK to select the difficulty level in the menu bar and / or in the toolbar. Or if we also want a independant widget for this, that could be placed in the status bar for instance, like in bovo right now.

We should also include the menu item "Game difficulty" in the standard UI RC file of kdelibs. Before that, it has to be explicit added in the UI RC file of every game using this class.

So, please give some feedback. :)

(I spoke with Johann about this change at the aKademy.)

I fixed also KBlackBox to use this class now. It's the first game to use it as a proof of concept. (And in KBlackBox it's better to have predefined difficulty levels, so the player doesn't have to configure the number of balls and the grid size like before).

If the feedback is good, I would be glad to fix the other games.

File Changes

Added 2 files
  • /trunk/KDE/kdegames/libkdegames
  •   /kgamedifficulty.cpp
  •   /kgamedifficulty.h
Modified 7 files
  • /trunk/KDE/kdegames
  •   /kblackbox/kbbgamedoc.cpp
  •   /kblackbox/kbbgamedoc.h
  •   /kblackbox/kbbmainwindow.cpp
  •   /kblackbox/kbbmainwindow.h
  •   /kblackbox/kblackbox.kcfg
  •   /kblackbox/kblackboxui.rc
  •   /libkdegames/CMakeLists.txt
9 files changed in total