tags:

views:

106

answers:

3

Hello, I'm creating this (big?) project in high school where I'm programming the game Shithead (card game) (so that two people can play against eachother). I'll use mostly PHP, MySQL, JavaScript and Ajax.

But I have never made a project like this before. I have only made like CMS-systems and so on. Do you guys have any tips on how I should structure this project?

I'm also not so used to Object-oriented programming, but I guess I should consider this. Should I, for example, make a class for the cards? I'm very thankful for any tips or good links!

A: 

I think the best thing to do is read some articles about object oriented programming, and then move to article about MVC in PHP.

I'm also supprised you managed to create a CMS, but a card game seems to be a 'big' project?

Nicky De Maeyer
Well, a simple CMS.
Per
A: 

You'll probably want to use a PHP framework for a larger project like this. Not only does it give you ways to structure your files, but many components of your app will be done for you.

You can see a list here.

The big ones are CodeIgniter, Symfony, and the Zend Framework. CodeIgniter is probably the easiest to learn (it was the first one I learned), but it's a bit dated.

I'd personally recommend Kohana. It started off as a PHP5 port of Code Igniter, but now it's grown into its own. They just released 3.0 like 2 weeks ago.

ryeguy
I'm confused - these are all CMS-systems, the thing he said he created. He wants to know how to structure a card game, not manage content. Why is this relevant?
Nona Urbiz
@Nona - these aren't CMS systems at all. They are frameworks for developing any kind of structured PHP application. As a matter of fact, I wouldn't NOT use one unless I'm making a quick one-off script.
ryeguy
A: 

Object Oriented programming is probably the way to go, but if your not to familiar with it, you may be better off handling this in a procedural manner your more used too.

for example, for this kind of project (bear in mind i'm not real familiar with the rules of this game) I would have a 'card' object a 'deck' object (just a collection of cards, with maybe a suffling algorithim of some type), a 'player' object that contained a 'hand' object made of up the cards, and some kind of 'field' object that represented the game going on, and would contain the players, the deck, and anything else it needed to contain, i.e. discard piles, score, or whatever else the game called for.

GSto