Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Whats the best way to walk around?  RSS feed

 
Sean Magee
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everyone! I am trying to create my first game. It is going to be a text based RPG. Right now, i am just trying to figure out a way I can get a player to move around the world. For example on lets say the first move,
would be something like

"you have entered the room"

1. Desk
2. Door on left
3. door to right
4. door behind you

------------------------
Now, if you pressed 1, you would go to the desk and have these options:
----------------------
"you are now at the desk"

1. read note
2. leave desk
-----------------------
and if you pressed 2, you would go BACK to the options:
------------------------------------

"you have entered the room"

1. Desk
2. Door on left
3. door to right
4. door behind you
-----------------------------
And, well, thats how i want the player to be able to move within a limited world. Well, i have already tried numerous ways of doing this. Does anyone have any pointers to a good way to start this off, basic overview of design?
 
Ray Muirhead
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool Sean -- I've been working on something similar for a while now so maybe I can help a little.

The example project that is available from the Blue J resources page is good.

I've found that for me a good way to start is to work out what objects are needed
i.e in this case the Desk, Room etc. could all be Places or something similar, and to have a Player or Character object that can move between them. The Place would have references to all of it's neighbouring Places, and would be the object that you would ask where you could move (as the player). Keeping it as simple as possible seems to be the best way to do it.
The BlueJ zork game is an excellent place to start, in my opinion. They have a good system and a parser as well if you were interested in making your game take text commands.

If you have any more questions or just want to bounce some ideas off someone, don't hesitate to post again and I'll see if I can help.

Good luck Sean!
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put one foot in front of another? Oh and make sure you are standing.

Sorry, feeling sarcastic this life.

Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!