Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text based browser game [closed]

I wanted to create a text based browser game, so how should I go about? I can do programming in asp or jsp or php that is not a barrier, but I am unaware of what steps that one needs to follow while attempting to make such games. So please guide me.

please also recommend me a programming language for making the same.

like image 279
5lackp1x3l0x17 Avatar asked Sep 19 '09 10:09

5lackp1x3l0x17


People also ask

Can you still play text adventure on Google?

Search for “text adventure” without the quotes. Open the JavaScript developer console by pushing Command+Option+J on a Mac, or Ctrl+Shift+J on Windows. You should see a prompt asking if you “Would like to play a game?” Type yes and push enter, and the game will start!

What are those text games called?

Text adventures (sometimes synonymously referred to as interactive fiction) are text-based games wherein worlds are described in the narrative and the player submits typically simple commands to interact with the worlds.

What are text-based adventure games called?

Text-based adventure games (also known as Interactive Fiction, or IF) are a classic game genre where all the interaction takes place through on-screen words. Despite their primitive origins born from hardware limitations, this type of adventure is still alive today and enjoyable on modern devices.

What was the first text game?

Colossal Cave Adventure was the first text-based adventure game—It was developed in 1976 using one of the earliest computer programming languages, at the same time as the earliest version of the internet itself, ARPANET.


3 Answers

One of the simplest browser games is just a series of static pages with links on each page leading to other pages. Often there will be some "story" on the page followed by a few choices you can make. Different choices lead to different pages.

The next step up is to use dynamic pages instead. When loading a new page, the browser can send some variables to the server and the server can generate a page on the fly. This saves you the effort of creating lots of similar pages by hand, and also allows you to do things like random outcomes.

However, if you want to keep a lot of user state (such as inventory, skills, or whatever), it becomes cumbersome (and insecure) to continually pass this from server to browser to server. This is what session handling is for: it remembers a user for a while, and lets you remember some variables at the server side.

If you want a more interactive game, you would need to look into Javascript and perhaps AJAX, which allow things to change in the browser without needing to load a new page.

In terms of language, I would suggest Python CGI, 'cause I like Python. Start with something simple so you can get a better idea of what you're working with, before you design something large.

Have fun!

like image 127
Artelius Avatar answered Sep 28 '22 02:09

Artelius


Sounds like you could map it out using a state machine (in any of your chosen languages)...could be a fun little project (:

like image 37
Kieron Avatar answered Sep 28 '22 02:09

Kieron


create a map - basically a two-dimensional array of "rooms" - alternatively you can make it three dimensional if you need to have your character go up and down as well...

then in the game when the player moves character to the south, just find that room in the array.

array could contain all required things related to the room (description, objects, NPCs etc.)

like image 23
dusoft Avatar answered Sep 28 '22 00:09

dusoft