| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|||
|
Auto Move Problem(Ti-83 plus)
Hey im making a simple snake game to keep me occupied in math class and i came up with the auto move for the beginning of it:
(Operating on Ti-83 Plus and building this without a linking cable) :ClrHome :4->X :5->Y :Lbl A :randInt(1,4)->A :If A=1 :Goto D :If A=2 :Goto U ::If A=3 :Goto L :If A=4 :Goto R :Output(X,Y," " :Lbl D :X+1->X :If X=9 :1->X :Lbl U :X-1->X :If X=0 :8->X :Lbl L :Y-1->Y :If Y=0 :16->Y :Lbl R :Y+1->Y :If Y=17 :1->Y :Output(X,Y,"*" :Goto A It works fine other then the fact it doesnt move down or left i think it has to do with my not being used to the x,y coordinates of the cal but im not sure.... Any ideas? |
|
|||
|
This might help
Quote:
I saw that your's wouldn't send itself back to the main index (where you had the randInt( command), and also, on only one of your Lbl U, D, L, and R, would redisplay the new place of the "snake", or dot. I made one that is smaller, works in the same way, eliminates all Labels, and has an endless loop. Here it is with side notes where necessary to help you out. :ClrHome :1->A (Same function as in yours) :0->B (Necessary for the endless loop) :4->X (Or wherever you want it to start) :5->Y (Along with here) :While B=0 (As long as B=0, it will repeat everything below... :randInt(1,4)->A (until the "End" command, and because nothing ever... :Output(X,Y," " (happens to the variable "B", and it therefore... :If A=1 (always stays 0, this part repeats infinitely) :X-1->X (This part merely sums up what was in your labels) :If A=2 :X+1->X :If A=3 :Y-1->Y :If A=4 :Y+1->Y :If X=9 (The values of "X" and "Y" are changed here if they... :1->X (become too high or too low) :If X=0 :8->X :If Y=17 :1->Y :If Y=0 :16->Y :Output(X,Y,"*" (The new value of "X" and "Y" redisplayed here) :End (This is here so the While command knows when to repeat) : That works for me, but tell me if you have any problems with it. It might be just that it goes too fast, you can't see the asterisk very well, or just a personal preference that I might be able to fix. |
|
|||
|
Does anyone know how to make another character of any sort move while yours moves also?
I've gotten it so that it will move every time you press a button, but I can't make it so that you don't have to press a button to make it move. |
![]() |
| Viewing: Dev Hardware Forums > SOFTWARE > TI 83/84 > Auto Move Problem(Ti-83 plus) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|