![]() |
|
PHP checkers game |
superstar4410
Member #926
January 2001
![]() |
Ok, I'm pretty good at php and I need some advice. If I were to make a checkers game in php (probably using as well for data storage) I'm not talking about coding samples, just the concept as to determining legitimate moves and the format I would use to store piece locations and capturing pieces, etc. As I said I don't need any code examples just the a sound structural idea which if I understand I can easily translate that to code. Thanks a billion Don't take yourself too seriously, but do take your responsibilities very seriously. |
Matthew Leverton
Supreme Loser
January 1999
![]() |
Are we to assume this is a multiplayer client-server program played within a web browser? |
superstar4410
Member #926
January 2001
![]() |
Yes Two human players playing on the same pc, turn based. Not to different computer (good question) Don't take yourself too seriously, but do take your responsibilities very seriously. |
Matthew Leverton
Supreme Loser
January 1999
![]() |
Why use PHP at all? It sounds like all you need is some HTML and Javascript. |
superstar4410
Member #926
January 2001
![]() |
Just because those were the project specs. But yea I was thinking javascript myself because of it Don't take yourself too seriously, but do take your responsibilities very seriously. |
James Stanley
Member #7,275
May 2006
![]() |
This sounds like you're asking for your homework to be done for you. |
superstar4410
Member #926
January 2001
![]() |
Nah not homework. Actually I just got finished. You can view it here http://www.dimdigital.com/temp/checkers2.php How it works is both players meet at that site and can play aganist each other You can test it by opening up the link in two different browsers click on start game on both and pretend one window is red and the other is white, and play accordingly. Yea I got the basic checkers javascript code online from here Yeaa,I'm proud of myself on that one Don't take yourself too seriously, but do take your responsibilities very seriously. |
LennyLen
Member #5,313
December 2004
![]() |
I tried, but got this: Warning: mysql_connect(): Access denied for user 'dimdigit'@'web.ahp01.lax.affinity.com' (using password: YES) in /nfs/cust/4/68/37/573864/web/temp/checkers2.php on line 2 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /nfs/cust/4/68/37/573864/web/temp/checkers2.php on line 3 Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /nfs/cust/4/68/37/573864/web/temp/checkers2.php on line 6 Warning: mysql_query(): A link to the server could not be established in /nfs/cust/4/68/37/573864/web/temp/checkers2.php on line 6 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /nfs/cust/4/68/37/573864/web/temp/checkers2.php on line 8 Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /nfs/cust/4/68/37/573864/web/temp/checkers2.php on line 20 Warning: mysql_query(): A link to the server could not be established in /nfs/cust/4/68/37/573864/web/temp/checkers2.php on line 20 Error inserting table row Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
|
superstar4410
Member #926
January 2001
![]() |
Don't take yourself too seriously, but do take your responsibilities very seriously. |
LennyLen
Member #5,313
December 2004
![]() |
That gives me a 404.
|
superstar4410
Member #926
January 2001
![]() |
I lost connection as I was uploading Try this one, should work http://www.dimdigital.com/checkers/checkers2.php Type in some names and click start game, (open up link in two browsers or play with your friend on another computer Don't take yourself too seriously, but do take your responsibilities very seriously. |
Indeterminatus
Member #737
November 2000
![]() |
Seems to be some broken logic. I made two turns as player red, as shown in the attached screenshot. With the last state, a dialog box came up that said "There is a jump available", and now it won't let me do anything else but jump ... only where? Also, I never made a move as player white, apparently the system didn't give a sh*t about my cheating attempt {"name":"595752","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/9\/b92262480ca485fd678ace3f20ea5ad3.png","w":287,"h":269,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/9\/b92262480ca485fd678ace3f20ea5ad3"} _______________________________ |
superstar4410
Member #926
January 2001
![]() |
More like incomplete logic than broken. Good learning project, that was my second AJAX project. My first http://www.dimdigital.com/chat.php But I'll probably not be online to respond when you send a message to the link above. Don't take yourself too seriously, but do take your responsibilities very seriously. |
Tobias Dammers
Member #2,604
August 2002
![]() |
A checkers game that doesn't check all the rules of checkers isn't anywhere near 'finished'. It doesn't even really count as a checkers game. --- |
superstar4410
Member #926
January 2001
![]() |
Ever heard of the honor system, just dont cheat. Since if you do the computer wont tell on you or stop you from doing it. LOooLLL J/K I"m just being silly. What can I say I get lazy at times Don't take yourself too seriously, but do take your responsibilities very seriously. |
Tobias Dammers
Member #2,604
August 2002
![]() |
Yeah, but then, why bother writing the game when you could just play checkers in MS Paint: draw a board, draw some pieces, mail crappy .bmp to opponent. There, I just coded my first checkers. --- |
Wilson Saunders
Member #5,872
May 2005
![]() |
As an intellectual exercise making a browser based checkers game seems like a fun idea. However I have my doubts as why anyone would give you money to make one. Especially one that does not enforce the rules of the game. I know a little about php and don't think is is a very good language for making some thing complex like checkers. Flash's action script, which I am just starting to learn, seems more robust especially since it can listen for mouse events without having to swap screens. It also has a interval call back so you can have the program query the database every few seconds. As for coding concepts for a multilayer program: player1Name // some text so friends could identify each other. If you insist on doing this in php you probably also need to remember which piece the user selected in a separate field so you know which piece to move on the user's second click. However Actions script can remember this for you so the database only needs to remember stuff that should be communicated to the other user. ________________________________________________ |
Jonatan Hedborg
Member #4,886
July 2004
![]() |
You would probably do the interface with Javascript, otherwise you would be in for a pretty horrible coding experience. I'd say making it in flash is easier (the gui) in some aspects, and harder in some. It could not be made solely in flash for example, since flash can not connect to a database (unless you write a whole db interface using it's tcp/ip sockets... have fun with that
|
Tobias Dammers
Member #2,604
August 2002
![]() |
Quote: I know a little about php and don't think is is a very good language for making some thing complex like checkers.
PHP is just fine, if you can handle it. However, for a browser-based game, client-side script is essential in avoiding unnecessary round-trips, so some javascript knowledge is a must. --- |
|