Durak Card Game (PulpCore)

Hello everybody,

I’m writing (so it’s a WIP) a Card Game Applet using PulpCore as the Game/Graphics Engine. It is an implementation of a popular russian card game, called “Durak” (Idiot). You can learn about the Game mechanics here: http://www.pagat.com/beating/durak.html or http://en.wikipedia.org/wiki/Durak
I could simply sum up that durak is a strategy game where the purpose is to not be last player that still has cards in his hands. There is always a defender which has to cover cards and up to two attackers that attack. The attacker and defender roles rotate after each round. But there is much more to the game than this.

Actually, since it is a personal project for learning purposes, as of now, I’d like to have suggestions from you about my program structure / programming style. Before I polish and finish this project I’d like to ensure that the code is “good” (aspects like reusability, comprehensibility…). Since there is no such subforum, I posted here, which is not bad either since I’m going to finish this project soon anyway and then just post the finished version in this thread.

So here is a link to a “playable” (it is not yet everything implemented) version: http://storytube.kilu.de/durak7/
Without knowing the rules of the game it seems random, so you should have a look at the rules. Controls are double-clicking anywhere for taking the cards or not adding an attacker card. And for putting a card onto the arena: clicking and “throwing a card in the arena” (click, drag fast enough and release).
Here is a link to the netbeans project with sources: http://storytube.kilu.de/Durak_0.8.tar.gz

Basically, I’d just like to have critic about the source code. It can be anything, but especially critic about the “macro-design” (so to say), how well/bad the inter-class-dependencies (i hope you understand what I mean) are designed, and how well/bad the class design and the use of design patterns is. Of course I’m also interested in everything else that you find to critise.

My basic design:
I’ve used the MVC (more MV) pattern for the whole program structure. First of all I’d like to know if I implemented it reasonable.
I tried to stay true to the paradigm “composition over inheritance”. I also created a little bit javadoc which can be found in the package. I’d also like to know ideas about alternative, maybe more efficient ways of structuring a 2D card game in java and maybe suggestions if it would have been easier to implement specific things in other languages (because of other language features).

Ok, I hope someone looks at the source code!

Btw, if someone is good at graphics creation and is interested in contributing to this project: I’d need general advice about designing the playing table (like where the opponents should sit, how big the cards should be), a background graphic, a logo, a label for the player names and a very small defender symbol (like a shield or something)

best regards,
newgame

I don’t really understand the game but it seems to work fine…!?
For ideas on how to present card games you could take a look at some of the online poker sites (without joining of course!), there’s some pretty innovative presentation styles you could ‘borrow’ from them!

I just wanted to update this thread.
Here is a newer version of the game http://storytube.kilu.de/durak10/

Yes, I draw the graphics myself and as you can see it’s the work of a master of arts. I didn’t find volunteers for drawing (even if I hoped to find someone I did not expect any volunteers) that’s why I did it myself :).

I did not add anything new to the game since the last 6 days because there was some “bug” that I just could not solve without changing the whole structure of the program. So I thought that is up until now. Unhoped-for, I had an idea to fix that “bug” quickly (yet ugly) so that I could upload a working version of the game. Note that the performance is rather bad but I did not concentrate on improving it just yet. There are still some small inconsistencies regarding the game play logic, however, overall I’m happy with the game play logic.

I realized that I’d have to redesign the code if I wanted to add the other features which I have in mind. So this is basically the next step to this project. You do not know any boards that deal specifically with game programming techniques / game program design (with java), do you ? I know software design in general is of course applicable to games. Nevertheless I think games are a special case that need specific design approaches.

Eh… this one? :slight_smile:

Don’t worry too much about having the perfect architecture/design the first time. Try to focus on making a fun game, and then start refactoring the code with the things you learned in that time. Every year when I see my own code from a year before it seems incredibly bad to me, which hopefully means I’m learning more and more :slight_smile:

I’m blind :)! When I saw the “game design” subforum I thought it was mainly about designing a game in general but not its program structure, but I as looked into the subforum I realized it is exactly what I was looking for :). Ok, so I’m going to create a thread with my questions there :slight_smile: unless the other threads do not already answer my questions.

Although I acknowledge your advice, I can’t agree with you. I mean I don’t have a deadline for my hobby projects :), so I don’t have to get them done “somehow” if time is getting short. I can do it right - from the beginning. Plus I want to learn from the projects and it makes fun redesigning the program, seeing how it becomes more comprehensible.
Of course you’re right when you say that I may wonder how bad the code looks in a year from now when I am more experienced. But like I said in the first post; ultimately my goal is not the game per se, but the journey to the finished game (oh this sounds cheesy :), but I hope you get what I mean).