[Kde-games-devel] Re: Review Request: Change levelsets from KConfig to QDom style and create class LevelLoader

Julian Helfferich julian.helfferich at googlemail.com
Mon Feb 21 01:13:41 CET 2011


Hello,

I am a big fan of the game KBreakOut, but always thought it is sad, that it
includes only one levelset. I am working on a way to enable players of
KBreakOut to create, share and play their own levelsets. I have already
emailed with Fela, the maintainer, about my plans.

I would be very happy, if you would comment on my code. The main changes are
in GameEngine::loadLevel() which has been moved to LevelLoader::LoadLevel().

Best regards,
julian

2011/2/21 Julian Helfferich <julian.helfferich at googlemail.com>

>    This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/6541/
>   Review request for KDE Games.
> By Julian Helfferich.
>
> *Updated Feb. 20, 2011, 11:56 p.m.*
> Changes
>
> The changes in CMakesList.txt were only made to allow a local build. They should not be included in the patch.
>
>   Description
>
> I have moved the function loadLevel() in GameEngine to an external class LevelLoader and changed the style of the levelsets from a KConfig style to a QDocument object model (QDom) / XML-style. This is the first step in empowering (and encouraging) players to create, share and play their custom levelsets.
>
> This patch addresses no bug and adds no feature. There are no changes to the user experience.
>
> The QDom-style levelsets provide two main advantages:
> 1. More robust against errors:
> Checks can be implemented very easily. An invalid levelset now leads to an empty level which can be played (but never won, because no last brick can be destroyed) instead of strange behaviour (mouse visible, but confined to KBreakout-Window). For the old style a list of gift types and a corresponding number of gift types had to be maintained in globals.h . This is not needed with the QDom-style.
> 2. Easily extendable:
> Up to now the only two options are identical with the old style: <line></line> and <gift></gift>. New options are planned including <brick></brick> for the placement of single bricks and the possibility to set the position of a gift. This should empower the user to create his own levelsets with different written styles.
>
>   Testing
>
> Testing has been done with a version prior to the port to KGameRenderer. Since the patch does interact with graphics, this should have no effects. Code works as expected, even when dealing with a broken levelset file.
>
>   Diffs (updated)
>
>    - /trunk/KDE/kdegames/kbreakout/levelsets/default.levelset (1221881)
>    - /trunk/KDE/kdegames/kbreakout/src/CMakeLists.txt (1221881)
>    - /trunk/KDE/kdegames/kbreakout/src/brick.h (1221881)
>    - /trunk/KDE/kdegames/kbreakout/src/brick.cpp (1221881)
>    - /trunk/KDE/kdegames/kbreakout/src/gameengine.h (1221881)
>    - /trunk/KDE/kdegames/kbreakout/src/gameengine.cpp (1221881)
>    - /trunk/KDE/kdegames/kbreakout/src/gift.cpp (1221881)
>    - /trunk/KDE/kdegames/kbreakout/src/globals.h (1221881)
>    - /trunk/KDE/kdegames/kbreakout/src/levelloader.h (PRE-CREATION)
>    - /trunk/KDE/kdegames/kbreakout/src/levelloader.cpp (PRE-CREATION)
>
> View Diff <http://svn.reviewboard.kde.org/r/6541/diff/>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-games-devel/attachments/20110221/e804192d/attachment-0001.htm 


More information about the kde-games-devel mailing list