LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Questions about writing a website game (https://www.linuxquestions.org/questions/programming-9/questions-about-writing-a-website-game-650263/)

sadarax 06-19-2008 03:54 AM

Questions about writing a website game
 
I need some advice for I am writing a simple website card game between two or more players. Each round, the players play their action cards and attack the opposing character cards. Each player needs to be able to execute actions and also receive feedback results from each round played.

There will be a program that actually runs the game, and a player webpage interface (that runs in a web-browser obviously). Here are some issues I need help/advice on:

Development Language: I am not sure which languages to write this game in. I know Perl, but I am not sure if that will do all of the job, or if there another language (Javascript) I should use as an extra tool. Or if I should choose different language all together.

Synchronizing Activity: Players need to know when they can input their actions, and also need to know the results of the round. A player may have to wait for their opponent to act, so the web interface must be capable of receiving new data. I figure web interfaces would probably need to maintain listening connection to the actual game program running on the webserver. Or it would need to periodically ask the server for updates.

pinniped 06-19-2008 05:12 AM

Language: You can use any really. Will you be using CGI or POST requests?

Synchronizing: let players click as they please; you just have to queue the action and ignore further clicks. You cannot send data without being queried for data - but you can serve up a webpage which periodically checks for an update.

graemef 06-19-2008 05:22 AM

Using AJAX (Javascript in conjunction with a server side language) you can delay the reply to the user until all users have submitted their actions.

rubadub 06-19-2008 05:53 AM

For a server side language PHP is a good choice for a beginner, you could use a flat-file database (stored in files) or something like mysql (better).

Also i'd assume you'd want some kind of login, user registration facilities as well...

sadarax 06-19-2008 06:23 AM

I do not know PHP or Ruby or even Javascript. I do know Perl, Java, and C/C++ though. I was wondering if using Perl might be feasible for portions of the program.

Javascript and AJAX sounds like a nice combination. EDIT: The first few pages on Google lead me to believe that Javascript and AJAX will work well together.

rubadub 06-19-2008 06:57 AM

Yes, perl can do exactly what you want, I prefer php because of it's c++ style syntax, but either will do and more servers will have perl.

AJAX is basically JS but with sockets... You use it to call your perl/php scripts, it's not like a standard client/server model, but moreover you just fetch webpages, the content is the result... All very easy.


All times are GMT -5. The time now is 01:09 PM.