TIB: Re: Re:GetKey


[Prev][Next][Index][Thread]

TIB: Re: Re:GetKey




OK that routine you are refering to is probably:

Lbl A
Repeat Ans                        ;BTW:Thanks for this
GetKey                                ;Josh, never thought of
End                                    ;  it in 2 years. It's so
obvious!!
if Ans = 11
prgmPROGA                    ; Call a subprogram
if Ans = 22
prgmPROGB                    ; Call another subprogram
....
...
Goto A

PROGA would contain the instructions you want to execute if "button11"
is pressed and a RETURN at the end, PROGB would contain the
instructions you want to execute if "button 22" is pressed and a
RETURN at the end.

I don't see how this would be better or faster than Josh Cunningham's
routine though. Granted it's a bit simpler to understand or write.
Another advantage is that you can simply call the program to move up
one space from anywhere in your prog. But I've always hated having a
lot of subprograms with my progs...

Ok, if you don't mind having a load of subprograms, do everything with
them, it makes programming a lot easier, but I don't think it can make
much of a difference for speed.

Philipp

> Thanks to everybody, but my routines are just not moving fast
enough.  In the
>RPG I'm creating, Bubba's Quest (watch for it:)), I have a little
character
>made of 2 letters (O and an X under it).  that moves around the
screen.  If he
>reaches the border of the screen, the game loads the next screen (a
string)
>into a string where it is used by the program.  But enough with the
background
>junk, here's what my problem is-
>
> The game takes about a second to move the character!  And with the
Ans
>variable, it appears to slowdown more each time you move before
finally
>greeting you with a MEMORY ERROR!  I remember reading some code that
used the
>Return statement and the Ans var to move the character, but it wasn't
>documented very well.   The writer said this made it faster.  I need
to know
>the fastest statement I can use for multiple keys.  All help is
appreciated:)
>
>Tatsuo
>