
Hello everyone! So, I am pretty much done with programming Snake Arcade. I'm about to release it soon on here, ticalc.org, cemetech.net, and possibly omnimaga. So, I programmed Nibbles (by Edward H) as the last mode, and I am trying to adjust the program where ending the game by defauly from collision detections inside the program, instead I want it to end outside of the program (the very bottom of the code) with no memory leaks. I have tried to do this, but it cuts down speed by about 25%. Since I can't really type it in by hand, I'll just explain what I coded. So the main loop of the program Repeat 0, I changed that to Repeat D with 0→D in the line before that. And the conditions that check to see if the snake either crashed into the wall or itself:
(First Check)
If pxl-Test(B,Ans-H)
Then
Text(27,34,"SCORE: ",θ
Return
End
(2nd Check)
If pxl-Test(Ans-V,A:Then
Text(27,34,"SCORE: ",θ
Return
End
The check to see if the user won:
If θ=95:Then
Text(27,34,"WIN.
Return
End
From what I observed in the code, there are 9 If checks inside the program. I do know that having Labels inside Loops don't cause memory leaks, So, I put the Goto's after the If H:Then and the If pxl-Test(B,A:Then checks, and the quit label right before the last 3rd End at the end of the program. By doing all of this, it cut down speed a bit. Is there an alternative solution to this to make it faster with no memory leaks?
At the beginning of the code, I put an extra variable D and with the If checks to end the game, I set the variable D to 1 in the checks and at the end of the 2 main loops and If D is 1, it goes to the ending loop.
Hewwo, my name is Achak Claw. I was formerly BioHazard.