This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
maverik94


Advanced Newbie


Joined: 20 Oct 2008
Posts: 57

Posted: 22 Jun 2009 08:25:11 pm    Post subject:

Ok, I am working on a scrolling-shooter-style game for the TI-83+. I am making progress, but I have run into a little snag. That snag is that somewhere in the program(s) the ram is being used up every time that part of the program is being excecuted. The way I know this is that every time an asteroid (theta) falls down, the program runs a little slower. I was wondering if anyone could see if they could find that place. Here is the code for the three programs in the game,

Here is a .zip file attached below containing all three BASIC programs
EDIT: I removed the attachment because This problem has been solved, and there's no need for people to bownload this incomplete version

Here is the code itself

Menu (the menu)

Code:

//PrgmMENU
ClrHome
Output(1,4,"SPACEFIGHT
Pause
Goto MN
Lbl MN
Menu("   Spacefight      ","Play",PY,"Help",HP,"Quit",QT
Lbl PY
prgmINIT
Stop
Lbl HP
ClrHome
Output(1,1,"HELP
Pause
Goto MN
Lbl QT
ClrDraw
ClrHome
Stop


init(the initialization script)

Code:

//PgrmINIT
ClrHome
ClrDraw
Output(1,1,"INITIALIZING...
Xmin
94->Xmax
1->Xscl
0->Ymin
62->Ymax
1->Yscl
1->Xres
CoordOff
GridOff
AxesOff
LabelOff
ExprOn
47->X
8->Q
randInt(6,67)->R
ClrHome
ClrDraw
prgmGAME
Stop


game(the actual game).

Code:

//PgrmGAME
Text(57,X,"^
Lbl A
While 1
getKey->K
If K=24 and X>7
X-4->X
Text(57,X,"^
Text(57,X+4,"   "
If K=26 and X<87
X+4->X
Text(57,X,"^"
Text(57,X-7,"      "
If K=21
Line(X+1,5,X+1,62
Line(X+1,5,X+1,62,0
Goto B
Lbl B
If Q>55
Then
Text(Q,R,"   "
5->Q
randInt(6,87)->R
Goto C
End
Lbl C
Q+4->Q
Text(Q,R,""
Text(Q-5,R,"   "
Goto A


I know that this game is far from finished, but I just uploaded the game as-is, it is run-able


Last edited by Guest on 22 Jun 2009 08:52:48 pm; edited 1 time in total
Back to top
calc84maniac


Elite


Joined: 22 Jan 2007
Posts: 770

Posted: 22 Jun 2009 08:41:02 pm    Post subject:

What's with all the labels in the main game code?

First of all, this is useless:

Code:
Goto B
Lbl B


Second, this is useless and causes a memory leak:

Code:
Goto C
End
Lbl C

Just use an End by itself.

Third:

Code:
Lbl A
While 1
...
Goto A

This causes another memory leak. Use this instead:


Code:
While 1
...
End


Last edited by Guest on 05 Jul 2010 08:29:57 am; edited 1 time in total
Back to top
maverik94


Advanced Newbie


Joined: 20 Oct 2008
Posts: 57

Posted: 22 Jun 2009 08:46:43 pm    Post subject:

im letting it run for a few moments to see if it is working, looks good so far, thanks, Ill tell you when I confirm if it is working 100%!
EDIT: of, it appears to be working, thank you very much calc84maniac!, if I complete this game I will mention you in the credits!


Last edited by Guest on 22 Jun 2009 08:48:29 pm; edited 1 time in total
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement