[Kde-games-devel] kmj

Wolfgang Rohdewald wolfgang at rohdewald.de
Sat Dec 6 09:24:57 CET 2008


Hello everybody!

I started writing a new game kmj

this is for the mah jongg game where 4 players play against each other.
Right now it can be used to make the payments between players and to
keep track of the results. But the scores themselves still have to be
entered manually.

later it should be possible that the user can say who had which tiles
at the end of the hand, and kmj will compute the scores automatically.
Which means I must support using different rule sets and make it possible
for the user to change them. For the core logic - does a specific rule
apply or not, and which tiles are used - I will use regexp (the player's
tiles and everything influencing the score being represented as a string).
On my computer it should not take more than 10ms to compute the scores,
I estimate after some first experiments (Intel running at 1GHz)

kmj is a name I dont really like - any other idea? At least it corresponds
to xmj. I added a pointer to kmahjongg in the about data just to
make the difference clear.

kmj is written in python. It saves results in sqlite3. And I use it as a
test bed to experiment with python, qt4 and kde4 since I am new to all
of this.

the tiles a those from kmahjongglib, I directly use those tilesets.
kmahjongg uses a QImage for drawing, but so far it seems to work very
well with just using QPixmaps. Do I have to expect problems on different
hardware or maybe Windows? I also have a class Board where I can
place tiles in a 2dimensional array using any angle (same angle for all
tiles).
The wind tiles in the attached screenshot are just 1x1 boards. Of
course overlapping tiles really overlap, drawing the lower tile first.

I have no idea yet where best to upload the source code. I am using
git for versioning, so maybe just put a tarball on my home page until kde
switches to git. Actually I would prefer to have it somewhere else.

screenshot attached

-- 
Wolfgang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 80414 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20081206/392df1b9/attachment-0001.png 


More information about the kde-games-devel mailing list