Re: TIB: Re:GetKey
[Prev][Next][Index][Thread]
Re: TIB: Re:GetKey
On Thu, 03 Dec 1998 08:28:14 PST "Josh Cunningham"
<rogue_ant@hotmail.com> writes:
>
>>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
>>
>
> Tatsuo, use the routine I posted, instead of using the plxon
>statement, supplement it with the Text( statements. You will find
>this
>to be way faster then one second, and minimal memory errors. I am
>working on a new Getkey routine that will be very fast. I'm
>estimating
>about 1.5 times as fast as the one I posted. But untill I get some
>inspiration, it wont be done.
>
>Josh Cunningham
Hello! My name is Philip and I'm new to the ti-basic list so I don't
know exactly the background behind this e-mail but I may be able to help.
I would consider myself an expert in TI85/86-Basic and Moderately
knowledgeable in TI86 assembly.
Anyway, about the MEMORY ERRORS you are getting:
The ONLY way you can get a memory error in TI-BASIC is if you do a
considerable
number of 'IF' statements without reaching an 'End' command.
For example:
:1->A
:If a==1
:Then
:Goto B
:End
If you have jumps like this in your program, the program will execute the
'Goto' command and never reach the 'End' statement. The calculator
thinks that the
"If-Then" loop was never completed and so it stores it in MEM (actually a
stack).
As the program continues to to execute loops like the one above, the
calculator will gradually slow down as the MEM fills up with uncompleted
"If-Then" loops. Eventually you will get a MEMORY ERROR.
Let me know if this helps, and what calc you are using.
Philip
------------------------------
pmadsen@juno.com
------------------------------
___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]