Hi,

I'm trying to make a little game in which you control a plane that's supposed to dodge objects. I got the objects scrolling and the plane moving, but it reacts kind of slow. I'm kind of stuck here, since I already tried to keep everything as small as possible. This is what I have:

Main Program:

Code:

ClrHome
5üY
5üX
ClrHome
DelVar [A]
{2,99}üdim([A])
"                "üStr1
"                "üStr2
"                "üStr3

For(I,1,7)
Str2+Str1üStr1
End

While 1
Output(Y-1,X+1,"A")
Output(Y,X,"=X=")

For(T,1,05)
getKeyüK

If Kø0:Then
Output(Y-1,X+1," ")
Output(Y,X,"   ")
End

If K=24 or K=26:X+(K=26)+(X÷13)-(K=24)-(Xù2)üX

If K=25 or K=34:Y+(K=34)+(Y÷7)-(K=25)-(Yù3)üY

Output(Y-1,X+1,"A")
Output(Y,X,"=X=")
End

prgmAASKY

End


prgmAASKY:


Code:

randInt(2,16)üL
randInt(1,2)üS
sub(Str2,1,L-1)üStr3
If S=1:Str3+"Ñ"+"               "üStr3
If S=2:Str3+"Ð"+"               "üStr3
sub(sub(Str3,1,16)+Str1,1,128)üStr1
Output(1,1,Str1)
Return


Those 'ü's are storage arrows btw. If anyone can point me in the right direction, that would rock Smile
1. Remove all line-ending )s
2. Then remove any line-ending "s

Change prgmAASKY:

Code:
randInt(2,16üL
randInt(1,2üS
sub(Str2,1,L-1üStr3
If S=1:"Ñ
If S=2:"Ð
Str3+Ans+"               "üStr3
sub(sub(Str3,1,16)+Str1,1,128)üStr1
Output(1,1,Str1
Return


Also, for cleaner code, use http://www.cemetech.net/projects/basicelite/sourcecoder.php
Sweet, thanks for the fast reply!
No prob. Try those and see what happens. I also see another problem, come back when you do that and I'll explain it.
I tried it, it works slightly better, but it stops responding for a second when it's refreshing the objects. This just takes too long Sad

What other problem do you see?
You can optimize this: If K=24 or K=26:X+(K=26)+(X÷13)-(K=24)-(Xù2)üX

If K=25 or K=34:Y+(K=34)+(Y÷7)-(K=25)-(Yù3)üY

some more. Tell you what. Run what you have now through the SourceCoder please and post the BBCode code.
Ok, here's what I have now. I optimized the controlcode a bit, there was a bug in it anyway (the 'plane' took two steps instead of one when it was near the edge of the screen). I also put the AASKY subroutine in the main program, I thought it might speed up the reactiontime if I distributed the apparently heavy subroutine over the main program.

BASIC Code wrote:
:5Y
:5X
:" "Str1
:" "Str2
:" "Str3
:
:For(I,1,7
:Str2+Str1Str1
:End
:
:While 1
:randInt(2,16L
:randInt(1,2S
:
:sub(Str2,1,L-1)Str3
:
:For(T,1,04
:getKeyK
:
:If K0:Then
:Output(Y-1,X+1," "
:Output(Y,X," "
:End
:
:X+((K=26)*(X13))-((K=24)*(X2))X
:Y+((K=34)*(Y7))-((K=25)*(Y3))Y
:
:Output(Y-1,X+1,"A
:Output(Y,X,"=X=
:End
:
:If S=1:"[Cross]
:If S=2:"[Box]
:Str3+Ans+" "Str3
:sub(sub(Str3,1,16)+Str1,1,128)Str1
:Output(1,1,Str1
:
:Output(Y-1,X+1,"A")
:Output(Y,X,"=X=")
:
:End
Generated by SourceCoder, © 2005 Cemetech


edit: I think the parser skipped the ClearHome on the first line, and the amount of spaces put in Str1, Str2 and Str3 in the beginning is 16.
Did you program this on an 83,83p, or 83pse?
83 (I bought this for school a few years ago), I'm still looking for a cheap 83+ or 83+se Smile
Ohhhh, ok. I think that's why I've been getting weird sourcecoder problems. *goes back to work*
So do you have any other suggestions? Or is this the speediest this program will get?

Nice job @ the sourcecoder btw.
KermMartian wrote:
Did you program this on an 83,83p, or 83pse?

That's TI-73 +10, TI-83+ , & TI-83+ SE to clarify. Very Happy
+10?
TI-73 +10 = TI-83

*checks* Surprised I don't have an 83 emoticon! shame on me.
It's a Ti-73 (there's no 83 emoticon), so I added 10 to make it 83. Very Happy

By the way Argoth, you should stick around these forums. You seem like a good guy. Good Idea
Jonathan Pezzino wrote:
It's a Ti-73 (there's no 83 emoticon), so I added 10 to make it 83. Very Happy

By the way Argoth, you should stick around these forums. You seem like a good guy. Good Idea


Ahhh, I just got the joke Smile

I will stick around, because I want to make the games I'm coding to work. Stupid slow calculators Smile
Argoth wrote:
Jonathan Pezzino wrote:
It's a Ti-73 (there's no 83 emoticon), so I added 10 to make it 83. Very Happy

By the way Argoth, you should stick around these forums. You seem like a good guy. Good Idea


Ahhh, I just got the joke Smile

I will stick around, because I want to make the games I'm coding to work. Stupid slow calculators Smile


That my friend is why we learn ASM. Smile
I know, but I love basic, I used to program in QBasic a few years ago and TI basic is a lot like that. I also like to code while I'm travelling. And I already downloaded like every z80 ASM tutorial I could find and read a lot of them, but I just can't get myself to get started Smile It seems like a lot of work Razz
KermMartian wrote:
Argoth wrote:
Jonathan Pezzino wrote:
It's a Ti-73 (there's no 83 emoticon), so I added 10 to make it 83. Very Happy

By the way Argoth, you should stick around these forums. You seem like a good guy. Good Idea


Ahhh, I just got the joke Smile

I will stick around, because I want to make the games I'm coding to work. Stupid slow calculators Smile


That my friend is why we learn ASM. Smile

Or not learn ASM and play Blockland/live in the real world instead. Very Happy
Argoth wrote:
I know, but I love basic, I used to program in QBasic a few years ago and TI basic is a lot like that. I also like to code while I'm travelling. And I already downloaded like every z80 ASM tutorial I could find and read a lot of them, but I just can't get myself to get started Smile It seems like a lot of work Razz


Argoth - I fixed the SourceCoder to work with 83 files correctly. Try it. Only remaining bug is the { } bracket thing. Sad
  
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 2
» 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