Revision 8158f09...
Go back to digest for 29th September 2013Features in Games
Enabled user defined key shortcuts.
The previous updates were reworked so now the game allows a player to
defined a custom set of keys to perfom each mouse action supported.
This commit contains a few modifications done by me, but the core work
has been entirely done by Season of KDE's participant Anuj Pahuja.
My modifications are basically a few refinements done to Anuj's work.
What I did:
1. Moved a #include<KAction> from gamewidget.h to gamewidget.cpp.
2. Renamed bindKeys()'s parameter to keyShortcuts. The previous
name denoted a private local pointer used in KBlocks, where all
this code derived from.
3. moveLeft(), moveRight() etc. were renamed to moveCursorLeft(),
moveCursorRight() and so on -- a more meaningful name in
KBounceGameWidget's context.
4. setCursorPosition() was reworked to include more conditions to
move the cursor, which simplified and reduced a few lines from
all moveCursor methods.
5. The methods needed for rotating the cursor and building the wall
were mixed into a single method. This way code duplication is
avoided and a more elegant sollution applied.
File Changes
- gamewidget.cpp
- gamewidget.h
- mainwindow.cpp