[Kde-games-devel] KNavalBattle Porting - Current Status

Roney Gomes roney477 at gmail.com
Wed Jun 20 13:27:45 UTC 2012


Hello everybody. :-)

This email intends to be a report about what I've been doing on
porting KNavalBattle and to expose to everyone -- especially Ian, who
is my mentor -- that I am really active and taking the whole project
as a serious and important task. I also believe that transparency is
something that should be more than encouraged when working with free
software projects. So, lets go to the news.

Currently I'm working on fixing some bugs related to the scenes --
yes, scenes. I decided that each player should have his/her own viewer
and therefore individual scenes are necessary -- and the welcome
screen which appears before each game. Previously everything was made
"by hand" and the code related to positioning stuff in the screen
seems kind of arcane to me.

I had to transform the player labels and the stats widget in real Qt
widget objects. What we had before was some sort of KGameCanvasItem's
emulating the behavior of a widget and, since this "emulation" is not
a Qt standard  stuff, the original programmer had to write some code
related to resizing and positioning those widgets on the screen. But
now they're all derived from Qt's widgets classes and we can use the
awesome Qt's layout management, which makes the code easier to
understand and considerably shorter also.

Some classes like Sprite and KBSRenderer have no use now;
KGameRenderedItem and KGameRenderer does everything we need. Although
is pretty much simple to work with KGameRenderer, I got a bit stuck at
the beginning because the documentation doesn't expose very clearly
that a .desktop file is necessary in order to load a theme. I'll try
to improve the documentation in the future, when I'm not that busy.

Attached to this email are some screenshots of the current state of
the porting, notice that the scenes' content is not appearing -- I hid
it because I don't want to show all the buggy things that still need
to be fixed.

You might ask about a diff file. Well, I decided no to upload it yet
since its not ready for revision. I changed some lines just to fit the
code in my readability preferences so it needs to be polished in order
to make everything easier to review. But if someone has the interest
in reading the code I see no problem in uploading it. Actually, I'd
like to be criticized, in a gentle manner of course. :-)

Salutations.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: before-first-game.png
Type: image/png
Size: 35424 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20120620/661c72cf/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: during-a-game.png
Type: image/png
Size: 44184 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20120620/661c72cf/attachment-0003.png>


More information about the kde-games-devel mailing list