Text browser game

I wanted to create a text-based browser game, so how do I go? I can program in asp or jsp or php, which is not a barrier, but I don’t know what steps need to be performed when trying to make such games. So please guide me.

please also advise me on a programming language in order to do the same.

+6
browser
source share
5 answers

One of the easiest browser games is a series of static pages with links on each page leading to other pages. Often there will be some kind of β€œstory” on the page, and then a few options that you can make. Different options lead to different pages.

The next step is to use dynamic pages. When loading a new page, the browser can send some variables to the server, and the server can generate the page on the fly. This saves you the effort of creating a large number of similar pages manually, and also allows you to do things like random results.

However, if you want to save a lot of user state (for example, inventory, skills, or something else), it becomes cumbersome (and unsafe) to constantly transfer it from server to browser to server. For this, session processing is intended: it briefly remembers the user and allows you to remember some variables on the server side.

If you need a more interactive game, you will need to look into Javascript and, possibly, AJAX, which will allow changes to the browser without loading a new page.

In terms of the language, I would suggest Python CGI because I like Python. Start with something simple so that you can better understand what you are working with before creating something big.

Good luck

+5
source share

It looks like you could display it using a state machine (in any of your chosen languages) ... might be an interesting small project (:

+1
source share

create a map - basically a two-dimensional array of "rooms" - as an alternative, you can make it three-dimensional if you need your character to rise and fall too ...

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

Array

may contain all the necessary things associated with the room (description, objects, NPCs, etc.).

+1
source share

Personally, I make a text game in python and then get it to talk to the web server. Thus, you can test the game without much hassle.

What game do you want to write?

you need to think about what the user can do. They can duplicate their window and send the same information twice. They can click back, which can ruin the game. You can force the user to send the time and session ID each time they click the "Submit" button.

ps the style of continuing the passage is one way to emulate the ability to call return. This is not an easy way to write things.

0
source share

Design Bring to life. Test. Play

If this is a text-based browser game, you should go with HTML. :)

-one
source share

All Articles