How could this be made to run more quickly?


Code:

AxesOff
:ClrDraw
:ClrHome
:FnOff
:0→D
:"0 2 4 6 8 0 23456789012345678901234567890123456789012345678 90123456789012345678901234567890123456789012345 67890123456789012345678901234567890123456789012 34567890123456789"→Str1
:Lbl A
:2+D→C
:For(B,1,7
:sub(Str1,C,15
:Output(B,1,Ans
:C+10→C
:End
:While Ans≠45
:0→A
:getKey
:If Ans=21:Then
:D+1→D
:45→A
:End
:End
:If A
:Goto A
:
:ClrHome
:Stop


[/code]

Ed. Note - tile string edited for sanity
The following changes will help both your speed and size slightly, but you're never going to get anything much faster than that in TI-BASIC, I'm afraid.


Code:
AxesOff
:ClrDraw
:ClrHome
:Delvar DFnOff
:"0 2 4 6 8 0 23456789012345678901234567890123456789012345678 90123456789012345678901234567890123456789012345 67890123456789012345678901234567890123456789012 34567890123456789"→Str1
:1→A:While A
:2+D→C
:For(B,1,7
:sub(Str1,C,15
:Output(B,1,Ans
:C+10→C
:End
:DelVar ARepeat Ans≠45
:getKey
:If Ans=21:Then
:D+1→D
:45→A
:End
:End
:End
:
:ClrHome
:Return
Here's the updated demo:



The whole thing is modular and can be easily rewritten to accommodate multiple levels.
Looks really nice. If I could suggest one thing that it seems KermM left out,
Code:
:sub(Str1,C,15
:Output(B,1,Ans
Could be (Correct me if I'm wrong)
Code:
Output(B,1,sub(Str1,C,15
Also, do you plan on using the stuff on the far right (the last 3 columns)?
That's part of the display. It's easy to remove the space or make it larger.
Looks great, Qwerty! I think I'd be very happy to play a game with that kind of map-drawing speed, wouldn't you? I don't feel that that's too slow from the screenshot.
Out of curiosity, what type of ROM did you use? Was it one that has 15mhz speed?
That was a TI-84+ SE, so yes.
Double post...

Working demo Very Happy



There are nine rooms to explore, with various things hidden throughout.

One wonders how this would look on the Prizm...
SON of a LEN Qwerty! You had to put that there, didn't you >:(

In all seriousness, looks good Smile Do you have collision of things? Like, if I walk into one of the deltas, will it do something?
Qwerty.55 wrote:
Double post...

Working demo Very Happy



There are nine rooms to explore, with various things hidden throughout.

One wonders how this would look on the Prizm...


Cool, mind posted the code for that?
That looks really great, Qwerty. Smile I'm also glad that you're using Doors CS! Smile
_player1537 wrote:

In all seriousness, looks good Smile Do you have collision of things? Like, if I walk into one of the deltas, will it do something?


Currently, the program reads it as just another object, although I hope to eventually have those as collectible objects.

That might have to be done in Axe/ASM, though. The demo is running low on speed since the engine is pure BASIC (sorry Kerm).
No need to be sorry. Smile Just be sure to make it a DCS program in whatever language you choose. Wink
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement