LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 06-19-2008, 04:54 AM   #1
sadarax
Member
 
Registered: Sep 2005
Distribution: Ubuntu
Posts: 249

Rep: Reputation: 30
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.
 
Old 06-19-2008, 06:12 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 06-19-2008, 06:22 AM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
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.
 
Old 06-19-2008, 06:53 AM   #4
rubadub
Member
 
Registered: Jun 2004
Posts: 233

Rep: Reputation: 33
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...
 
Old 06-19-2008, 07:23 AM   #5
sadarax
Member
 
Registered: Sep 2005
Distribution: Ubuntu
Posts: 249

Original Poster
Rep: Reputation: 30
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.

Last edited by sadarax; 06-19-2008 at 07:33 AM.
 
Old 06-19-2008, 07:57 AM   #6
rubadub
Member
 
Registered: Jun 2004
Posts: 233

Rep: Reputation: 33
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.
 
  


Reply

Tags
connection, game, perl, server, website


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
writing a game - what is the linux folder layout? jarro_2783 Linux - General 11 07-08-2006 08:20 AM
Game website messed up sound? NickC Mandriva 3 12-21-2004 09:34 AM
Game Instalation Questions... BiOnIcBuNnY Linux - Software 6 12-20-2003 02:31 PM
Petitioning game companies and writing to them MNKyDeth1 Linux - Games 3 10-08-2003 03:32 PM
a few game questions matt_w_lambert Linux - Software 1 07-31-2003 11:52 PM


All times are GMT -5. The time now is 01:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration