Quote:
Originally Posted by hello-world
There are many Chess and tactics Server using PGN files.
Are those games played on client side ?
Can anyone tell how they embed it into php ?
|
Depends.
I'd have to say though, I'd rather just use flash for that type of board game. ActionScript 3 offers you a lot of control in flow, and the ability to create movie files for each piece. Which offers a lot of possiblities as far as adding spice to the game. Like pieces that walk to their position with animation, animiated combat, etc etc. ActionScript 3 can also be bundled with SmartFoxServer - which would allow you to have a multiplayer chess game in about 2 or 3 days of work.
But as far as doing it in just PHP... that's not too difficult either.
You have to set up a series of rules for the game, ie: pieces can only move in this direciton, only move so many spaces.
You could do it purely in JavaScript, which would be only client side. The problem with that is you're now relying on the player to not change those rules. So you'll need to validate the users actions on our server side.
This can be done with ajax.
Now making this multiplayer is a little more difficult, as you'll need to handle and hopefully maintain several sessions at once. You must also force the user to respond.
There's several design methods to get around this, not all of which I'm allowed to speak of due to where I work ;p
If you're looking on where to get started: Try it in PHP and JavaScript + some Ajax. Shoot, I'd say just get it to respond to where you click on the board.
Then try to get it to allow you pick a piece, and move that piece to that place you click.
Then, try and get it to respect the rules you want to use.
And yes, use pngs :)