Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,679 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,184 people online right now. Registration is fast and FREE... Join Now!




How do you make a text based game!

2 Pages V  1 2 >  
Reply to this topicStart new topic

How do you make a text based game!

penguin541
post 19 Jun, 2007 - 07:57 AM
Post #1


New D.I.C Head

*
Joined: 19 Jun, 2007
Posts: 4


My Contributions


Can anyone provide me with a basic template for making a text based game in PHP? I would be most grateful! Thanks! icon_up.gif
User is offlineProfile CardPM

Go to the top of the page

snoj
post 19 Jun, 2007 - 08:33 AM
Post #2


$Null

Group Icon
Joined: 31 Mar, 2003
Posts: 3,304



Thanked 5 times

Dream Kudos: 700
My Contributions


Just as there is no spoon, there is no template.
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 19 Jun, 2007 - 04:05 PM
Post #3


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


You should have taken the blue pill.
User is offlineProfile CardPM

Go to the top of the page

penguin541
post 20 Jun, 2007 - 10:52 AM
Post #4


New D.I.C Head

*
Joined: 19 Jun, 2007
Posts: 4


My Contributions


that helps!
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 20 Jun, 2007 - 12:38 PM
Post #5


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


A deeper look into the above statements would reveal a relevance to your question. Perhaps I should elaborate though:

People often assume that there are templates for even the broadest of programming tasks. Templates that allow inexperienced programmers to produce perfectly-coded gaming masterpieces. This is the world of the fake spoons and blue pills; it doesn't exist.

In the world or red pills and missing spoons (also known as "the real world"), a person must first have an idea. That idea is then divided into logical pieces, which define the various tasks the software must perform. How this functionality is laid out is dependent on the capabilities/limitations of the development and delivery environments. Once the project has been mapped out (and revised several times), it is then translated into code.

This is a very simplified explanation of a basic development plan. The point of it is this: you first need to decide what you want your game to do, and break that into logical pieces. Then do some research on the various tasks at hand (prompting a user for input, storing input as a variable, reacting to the input, etc...). There are tons of tutorials online, for virtually any task you can think of.. If you are having trouble with specific tasks, then ask about those tasks. Most everyone here is happy to help with even the most basic of questions, but we like to see a little effort first.



This post has been edited by DilutedImage: 20 Jun, 2007 - 12:41 PM
User is offlineProfile CardPM

Go to the top of the page

snoj
post 20 Jun, 2007 - 01:13 PM
Post #6


$Null

Group Icon
Joined: 31 Mar, 2003
Posts: 3,304



Thanked 5 times

Dream Kudos: 700
My Contributions


More like 2 trillion cents.
User is offlineProfile CardPM

Go to the top of the page

fyrestorm
post 20 Jun, 2007 - 01:28 PM
Post #7


D.I.C Lover

Group Icon
Joined: 4 Apr, 2002
Posts: 3,103



Thanked 2 times

Dream Kudos: 228
My Contributions


I'll add my 2¢: Forms -> You're gonna need some way to capture input
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 20 Jun, 2007 - 08:30 PM
Post #8


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


QUOTE(hotsnoj @ 20 Jun, 2007 - 02:13 PM) *

More like 2 trillion cents.

Haha, nah, I'm cheap! biggrin.gif
User is offlineProfile CardPM

Go to the top of the page

penguin541
post 23 Jun, 2007 - 09:19 AM
Post #9


New D.I.C Head

*
Joined: 19 Jun, 2007
Posts: 4


My Contributions


Ok i just thought maybe a little bit of code to make something like that would be helpful!
User is offlineProfile CardPM

Go to the top of the page

fyrestorm
post 23 Jun, 2007 - 12:48 PM
Post #10


D.I.C Lover

Group Icon
Joined: 4 Apr, 2002
Posts: 3,103



Thanked 2 times

Dream Kudos: 228
My Contributions


it's difficult to get you started since you've given us no details other than the fact that you want a template.

you're gonna need to start with a thought, about where you want to go and where you want to end up, the stuff in between can be made up as you go along and the ending may change.

like i said, you're gonna need to start with a form. you said text based so i'm assuming you want to do an mmorpg/pbbg. you may want to look at http://www.eternalduel.com to see what they're doing.

you're gonna need more than just php though, you're gonna need a db so you can keep track of what people are doing.

as we said previously, just as there is no spoon, there is no template.
User is offlineProfile CardPM

Go to the top of the page

Styx
post 23 Jun, 2007 - 03:00 PM
Post #11


D.I.C Head

Group Icon
Joined: 4 Mar, 2007
Posts: 192



Dream Kudos: 225
My Contributions


It also depends exactly what you mean by "text-based game." Not only are there games built around php like kingdomofloathing.com, but there's also games built on top of php (e.g. forum-based) like twilightus.net [/shameless plug]
User is offlineProfile CardPM

Go to the top of the page

penguin541
post 26 Jun, 2007 - 10:10 AM
Post #12


New D.I.C Head

*
Joined: 19 Jun, 2007
Posts: 4


My Contributions


ok i thought php would be easier than doing telnet!

and the game i thought to make was like an MUD

This post has been edited by penguin541: 26 Jun, 2007 - 10:20 AM
User is offlineProfile CardPM

Go to the top of the page

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 06:36AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month