This should help a lot of you with problems. As has been mentioned, the code in the annotation "If pix-test(y,x)=1..." does seem to screw things up. This is the piece of code that causes the program to halt if you run yourself over. The program will work without it however. Delete it, and the program should run fine. If you see the two dots, then that is a good sign-it means that the program is mostly working. Press any of the arrow keys, and the game should begin. If an error is thrown, press two or "GOTO" and it will take you to the line of code that caused the error. Code is extremely picky, and the slightest error can cause it to stop working. Come through again and again, line by line, looking for any discrepancies. You will notice that the code is broken into sections of functionality. Knowing what does what will help you greatly in troubleshooting the problem. The first section lays out the basic structure of the program. The end of Line(10,-10... stuff concludes the static layout of the program. You should be able to execute the program with nothing after those four lines like he does in the video. If all you have is that section written, and it doesn't work, then look in there for you error. Beginning with the ":LBL1 :GETKEY" line, is where the coding for the movement starts. If you can load the screen, but move, start there and work your way down line by line looking for an error. Note that the calculator won't always tell you if a code is improperly written. It will tell you if a code doesn't make since, it won't necessary if you told it to do the wrong thing, so long as it is an actually command of some sort. After you've deleted the annotated "pxl-Test" code, you will be abel to run yourself over. I rewrote a section of that code, and it works fine. Here is what I used: " :If pxl-Test(Y,X)=1 and Y≠ A :Stop" This code should be written just under the line that says Pxl-Off(LY(K)...Basically what the code I gave you says is, if the pixel at the coordinate occupied by (Y,X) (the snake) turns off, and that coordinate is not equal to A (which is where the apple is) then stop the program. The reason is, because when there are two "on" signals to the same pixel, the pixel changes to off. The snake is on, but if it runs itself over, there or two "on" signals, which turns on of them off. This indicates that you've run you self over, and thus should stop the game. I am not exactly sure why this is, but if you run the program without this code, you will erase yourself as you run yourself over.
When he gets to the part about the border lines, you will want to put in the following: Line(-10,10,10,10) Line(-10,10,-10,-10) Line(-10,-10,10,-10) Line(10,10,10,-10) The first two numbers after "Line" are the starting X and Y coordinates, and the third and fourth numbers are the ending X and Y coordinates respectively.
For all of you who want to make it so you can run into yourself do this: After the x or y is changed, but before you do the drawPixel command, do If pxl-test(Y,X)=1 and Y =/= A and X =/= B Then Stop End
Im not much of a genius on calculators, so i can't figure out exactly where to put that in the code. I thought i put that code in the right spot, but then once i hit a wall it immediately had the pen that looks like a + thing appear and the whole game basically just paused.
pj6444 I updated the code so that when that happens, instead it clears the draw and just goes back to the regular empty calculator mode. However, there is just one more problem: running into the "apple" also stops the game. Could you do something like store a different number value in the apple or something similar that you could allow the snake to run into? Or is there a way at all to fix that?
I can't remeber what the variables for the position of the apple were, but if you know those you can add this to the if statement that you added. != is does not equal If pxl-test(y,x)=1 and (x!=appleX or y!=appleY) The appleX and appleY are A and B I believe, but I am not entirely sure.
Please like this so it gets up top: For everyone who has the error with the sides of the screens do this after you change the x and y position of the snake: If X=62 or X=1 or Y=1 or Y=94 Stop That should fix your problem
pj6444 if you do the following code, the boundaries have been greatly reduced invisibly. Are you sure? Try a remake of that boolean. I crashed and died when I headed too right
He's that type of guy that will program everything in 0,0000000000000000000000000000001 nanoseconds, but as it comes to explaining it.... it's the type of guy that is very good at written exams, but when it comes to oral exams..... :-p
I made a list of all the options in your video. Great job by the way! (I have a question, if I want to make the pixels bigger, how do I do that?) (Press read more for the whole thing) : ClrDraw : ZStandart : 1 -> D : 0 -> S : 5 -> dim(LX) : 5 -> dim(LY) : 1 -> K : 10 -> X : 10 -> Y : randInt(1,93) : randInt (1,62) : Horizontal 10 : Horizontal -10 : Vertical 10 : Vertical -10 : : Lbl 1 : getKey ->G : : Pxl-On(A,B) : If G=26 and D!=2 : 1 -> D : If G=24 and D!=1 : 2 -> D : If G=25 and D!=4 : 3 -> D : If G=34 and D!=3 : 4-> D : If D=1 : X+1-> X : If D=2 : X-1-> X : If D=3 : Y-1-> Y : If D=4 : Y+1-> Y : : Pxl-Off(LY(K),LX (K)) : If pxl-test(Y,X) and Y != A and X!=B : Stop : If X=62 or X=1 or Y=1 or Y=94 : Stop : Pxl-On (Y,X) : X-> LX(K) : Y-> LY(K) : If X=B and Y=A : Then : S+5->S : dim(LY)+5-> dim(LY) : dim(LX)+5-> dim(LY) : : randInt(1,93)->B : randInt(1,61)->A : End : : K+1->K : If K=dim(LX) : 1->K :Goto 1 You are welcomed!
Thanks, but at the beggining of the video, he did LX Then he pressed Enter and it appers "Error" but me it is {0 0 0 0 0}. After entering all the "codes" shown in the video in the program, when I going to start it, my graphing calculator say: ERR:SYNTAX 1:Quit 2:Goto Why?
TzT Infinity its not a 2 its a ( but if you typed it wrong only here then its okay just try to delete the line, run it, then when it gives you an eror just type it back it might work cause sometimes its just a calculator proplem not you
The Correct Code for the Walls are :Line(-10,10,10,10 :Line(-10,10,-10,-10 :Line(10,-10,10,10 :Line(10,-10,-10,-10 ------------------------------- oh and tip if you wanna crate your own games try to learn to code python on the computer, ti-84 code and python are pretty similar
Hey, so when I try to test it at around 4:20 it shows up for a second without the diagonal then it says: ERR: SYNTAX 1:Quit 2:Goto This is my code: :ClrDraw :ZStandard 0>S 5>dim(ʟY) 5>dim(ʟY) 1>K 10>X 10>Y randInt(1,93)>B randInt(1,61)>A Line(-10,10,10,10) Line(-10,10,10,10) Line(-10,10,-10,-10) Line(10,10,10,-10) I am using a TI-83+ and I dont really know what to do here as I have tried basically everything.
How do you change it to a smaller window? ITs really hard to see on my Calculator and is only 1 pixel wide to hit making it obvious that I am playing a game.
It's pretty easy to make a pause button (I chose the enter button but change the number to whatever you want for other buttons). Put the following under the part where you change direction 1-->p If G=105 and p=1 Then Pause 0-->P End If G=105 and p=0 Goto 1 Also, how would you make it so that you die when crash into your body? I tried to use the pxl-test but I couldn't get it to work. Where would you put it? And what would you write exactly? Thanks
Whenever I try to program it, it says ERROR: DOMAIN and it shows that I have a problem in the area it says: Pxl-Off (LY(K), LX(K)) .... I'm so confused, does anyone know why?
Coo! Never knew graphing calculators can do so much stuff!! I'm going to buy one for g12 math. Just curious could the snake and eggs have been programmed thicker?
Darragh Cooley If X=B and Y=A Then S+5->S Either this line dim(LY)+5->dim(LY) This line dim(LX)+5->dim(LX) Or this line has an error randInt(1,93)->B randInt(1,61)->A End
Whenever i start it up, it just has a floating plus sign. I try to move the snake but insteadthe plus sign moves(when i use arrow keys). Whenever i try to use numbers, itpulls me out of the game
It wouldn't let me control the snake, and I have a letter version of the calculator , and there are more pikers, causing the snake to be very small. How do I fix this
I've followed everything to a T and the only difference is that my calf is silver edition and yours doesn't appear to be. Everything displays right but the snake doesn't move and pressing any key takes me out of the program. Help maybe?
Odysseusfields You have to delete the code he told you to add in the annotation in the video, and then add it after you tell the code to draw the snake. I haven't quite figured out where that is, but I will keep you updated when I do.
ik you commented 7 years ago but i dealing with same issue in 2021 any help could you maybe help me figure it out lol your prob like 25 now or something so i doubt you even use this any more
@Sega Sonic do you know how to add or change color of either the snake or the apple on TI 84? Cause my snake never shows up and I’m guessing it’s because it’s on color white. If I could make the snake green or something I should be able to see it then. Also, my apple is very very tiny, like an almost invisible dot. I would very appreciate it if you could tell me how to make it bigger if you know by any chance. Thank you very much.
lol I found out why the bottom border didn't work This is how it should be Line(-10,10,10,10) Line(-10,-10,10,-10) This is line you messed up on, the one in the vid=Line(-10,10,-10,-10) Line(-10,10,-10,-10) Line(10,10,10,-10)
When i hit the apple it says ERR:ARGUMENT and when I press goto it points at the randInt part but I have completely compied your work. Do you have any tips for me?
I copied your code into my calculator exactly, but it still only makes an ever-growing snake. Would you type out all the code so I can double-check that I didn't make a mistake?
I am trying to do this on a Ti-82, but it doesnt like pxl-on(A,B), also im using L1(with number under) and L2 instead of LX and LY.. so i changed A,B to X and Y..it liked it but then didnt like pxl-on(L2(K),L1(K)) it says its a domain error...any help please?
It takes a while to load. I waited like a minute. It displays the borders and the food things that u are supposed to collect. But the snake's body isnt visible and i cant control it. Its stationary
How do I start the game? I have the program and when I execute it and press enter, the walls and two dots show up. I assume one is the snake and one is the apple, but what do I press to start controlling the snake?
i have a ti 84 plus ce, the color one, and my snake just stops at the end of the boundary and then gets stuck, then when i try to move with my arrows it starts using the pointer. Can u please tell me how to fix this issue. and can u also tell me where you got the basic code form so i can check through, thnx
My snake game works very nicely the only issue is that there are individual points that appear in a grid-like pattern across screen with around 4 point spaces in between. I can play, it is just difficult to see the spawned fruit and if i run into the stray points It is game over.