Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text rpg question
#5
hey there

Umm, let's see.

Let's see if I got this right: So are you using a command menu such as


Where would you like to go?
1-> Shoe Store
2-> Software Etc
(and so on)
_ <-- the input


?

Oh i think I get it... so you can type in southeast and it would take you southeast, right? Well, if you are in a certain shop you can use the INKEY$ variable to program keys that would only work for a certain area

what you should do is create a DO LOOP UNTIL loop where the user can input a key. You could have the movement instead of typing southeast northwest and so forth just be a diagonal pad something along the lines of

q w e w is up, q is upleft (northwest) e is upright (northeast)
a s d and soforth...
z x c

so your program could look something like this

Code:
DO
PUSH$ = INKEY$
'use the above line because it is more responsive than just inkey$
'alone.  For some reason there is a delay when you use an if inkey$
'statement, but if you use a push$ (when push$ = inkey$) it will
'work.
IF PUSH$ = "w" THEN WAY$ = "north"  'WAY$ is the clarifying var.
IF PUSH$ = "s" THEN WAY$ = "south"
IF PUSH$ = "a" THEN WAY$ = "east"
IF PUSH$ = "d" THEN WAY$ = "west"
IF PUSH$ = "q" THEN WAY$ = "northwest"
IF PUSH$ = "e" THEN WAY$ = "northeast"
IF PUSH$ = "z" THEN WAY$ = "southwest"
IF PUSH$ = "c" THEN WAY$ = "southeast"
'to create other commans for a certain shop you should use
'something like a variable called place$ that would tell what shop
'you are in...
IF PLACE$ = "shoes" AND PUSH$ = "b" THEN GOTO BUYINGSHOES
'and create a label called buyingshoes: that would have the buying
'process in it.
LOOP UNITL PUSH$ <> ""
'loops until a button is pushed....... you may want to change this to
'be until push$ = "a" or push$ = "c" and go through all the choices
'this is a little painstaking but it would help safeguard your
'program from glitches.
I got to go, email me @
NOVA@EDGEEMU.COM
if you need more help than that, but I think that is fairly seflexplanetory. (did I spell that right?! Big Grin )

-NOVA
ovaProgramming.

One night I had a dream where I was breaking balls. The next morning, BALLSBREAKER was born.

Quote: Excellent. Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Reply


Messages In This Thread
Text rpg question - by Placeborick - 03-03-2003, 06:17 PM
Text rpg question - by na_th_an - 03-03-2003, 07:18 PM
hmm - by Placeborick - 03-03-2003, 07:37 PM
Text rpg question - by na_th_an - 03-03-2003, 07:39 PM
Text rpg question - by NovaProgramming - 03-05-2003, 11:03 PM
Text rpg question - by ak00ma - 03-05-2003, 11:43 PM
Text rpg question - by NovaProgramming - 03-06-2003, 10:57 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)