Wanting to make a online all text based game

Trying to decide which language to program in

Page 1 of 1

2 Replies - 927 Views - Last Post: 10 November 2009 - 06:07 AM

#1 Dalidar91  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 7
  • Joined: 07-October 09

Wanting to make a online all text based game

Post icon  Posted 09 November 2009 - 08:32 AM

I am working with a friend to make an all text based game that people can play online. We ran into a problem tho appon looking at what type of code we should use we cam to a delemah we have to pick bewteen PhP and html. I was told by other people who are not programmers that we should use PhP. I do not know what to use so can you explain what language would best suit the game or if both languages can work. If both work which one is easier to use. I am not doing this for homework i am trying to do this just for fun. So please tell me what language is best to use. Thanks for all the help

Is This A Good Question/Topic? 0
  • +

Replies To: Wanting to make a online all text based game

#2 tharam04  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 13
  • Joined: 27-February 09

Re: Wanting to make a online all text based game

Posted 09 November 2009 - 08:46 AM

Well that all depends on the game that you are trying to develop and how it will be played. You could use Javascript for your game since you can use it without having to have multiple web pages.
Was This Post Helpful? 0
  • +
  • -

#3 dsherohman  Icon User is offline

  • Perl Parson
  • member icon

Reputation: 226
  • View blog
  • Posts: 654
  • Joined: 29-March 09

Re: Wanting to make a online all text based game

Posted 10 November 2009 - 06:07 AM

Anything web-based must use HTML, because that's what web browsers display. HTML alone is not sufficient, though, because it only describes what's visible on the page. With the sole exception of linking to other documents, it can't be used to actually do anything, so the only game you'd be able to make with it would be something along the lines of the old Choose Your Own Adventure books. ("You approach a house with a path going around it. Click here to follow the path around the house. Click here to go inside.")

CSS is often used along with HTML to control how things are displayed (size, colors, etc.), but is not strictly necessary. You'll probably want to use it, though, because black text in a single size and font on a single-column white background probably isn't what you want your game to look like.

If you want any sort of active real-time effects in the browser (buttons that light up, self-updating displays, scrolling status boxes, etc.), you'll need to either use Javascript for that or go to some sort of plugin (e.g., Flash) to handle it. I'd strongly recommend starting off without this sort of thing, then adding Javascript later after the basic functionality is in place. Doing it this way will help to get something that's usable even without Javascript ("graceful degradation" or "progressive enhancement") instead of requiring your users to have it turned on.

So those are the big three that will operate on the client side. HTML is absolutely mandatory, CSS is effectively mandatory, and you'll probably end up wanting to do something that calls for Javascript eventually, so count on needing all three of them.

Then we come to the back end. This is the code that runs on the server and will generate the HTML for the user's browser to display (and possibly also generate the CSS and Javascript, depending on how you do things).

PHP is a very common back-end language and very popular, largely because it's easy to get started with. You could do a lot worse than PHP, but there are several other options - Python, Ruby, Perl, and Java are the other major players for server-side web programming. You might want to look into one or more of the others, but PHP would probably be the easiest to start with, especially if you don't have a previous background in programming.

In summary, you have no dilemma. You don't need HTML or PHP, you need HTML and PHP. The PHP code will create the HTML for the user's browser to display.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1