• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Whats the best way to walk around?

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic