I am uploading a game where you are given X time to press the right key.

Code:
:ClrHome:ClrDraw
:AxesOff
:0→Q:... (this section just has a bunch of variable storage and isn’t the problem.)
:1000→A
:Lbl A
:A-B→A
:B+C→C
:For(M,1,C
:B+1→B
:ClrDraw
:randInt(1,5)→Z
:Text(55,(Z*22)-21,Z ;this section to be replaced by a sprite routine, but for now just using Z as the place holder.
:For(X,1,A
:End
:If getkey=Z+10:Q+1→Q:End:Goto A
:ClrDraw:AxesOn
:Disp “Loser” ;a much longer line of code to be added later, for statistical storing point data.
:End

The For( loop isn’t working like I want it to. I want, after X executions, to decrement the second For( loop by the number of executions the first one just made. But it decrements during every execution, thus making the game get much too fast way too early. I have many ideas, sprite routines, score keeping, difficulty editing, just a bunch of stuff to add later but I want the game itself to work correctly. Help?
  
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