[Kde-games-devel] Kplayer and game logic
cantabile
cantabile.03 at wanadoo.fr
Mon Aug 25 15:45:22 CEST 2003
Hello again, dearest list (and precious too!),
My problem today is with KPlayer logic.
I'm trying to program a little 'matches' game program. The players can
select as many matches in one single row as then wish to, but they loose
if they're left with one match.
The selection works ok, so far. I just switch the sprite frame in case
it is selected, and the match is thus grayed.
The problems :
1°
I want to add a computer player, and I didn't catch what to do (and
above all WHERE to do it). I have the game logic ready. What I need is
HOW to create a computer player and where do I write it's code.
2°
For my 'human' player, I can't use the standard playerInput function,
because clicking on a match isn't the turn end for the player. He may
want to select several matches, then suppress them.
I imagined this could be done with a 'play' button in my toolbar.
So, where can I put code, in order to trigger player change when my
player clicks a button ? A button has no KGAmeIO*, neither QDataStream&
nor QmouseEvent...So I cannot stream the move and consequently
playerInput isn't triggered...
Don't know if this clear.
I studied M. Henri great tutorial, and he has been of great help to me
already but I think I need some simpler game structure to start with.
Well, any help much welcomed, dear list ;)
Cheers.
Cantabile.
More information about the kde-games-devel
mailing list