0 Members and 1 Guest are viewing this topic.
ClrGraph:ClrText ->this will just make sure there is nothing on the screen1->X:2->Y -> sets your variables for your beginning locationWhile 1 ->begins loopGetkey->G ->sets all keypresses to G in a senseLocate X,Y,"@" -> commonly 'output(' in TI-Basic this will draw your symbol as point X,Y, or 1,1If (G=27 And X=/21) ->checks if getkey 27 (or right) is pressed and X does not 21 (the far right side of the screen)Then X+1->X ->add one to X, or in other words move to the rightClrtext ->gets rid of previously drawn character so you don't end up with a line of characters :PIfEnd -> ends the If statement If (G=38 And X=/1) ->if left key is pressed and not all the way to the leftThen X-1->XClrtextIfEndIf (G=37 And Y=/7) ->the next lines of code will be basically the same thing, but in accordance to up and down or YThen Y+1->YClrTextIfEndIf (G=28 And Y=/1)Then Y-1->YClrTextIfEndIf G=47 ->if exit is pressedStop -> .....well STOP! lolIfEndWhileEnd -> end the whole while loop
If (G=27 And X=/21) ->checks if getkey 27 (or right) is pressed and X does not 21 (the far right side of the screen)Then X+1->X ->add one to X, or in other words move to the rightClrtext ->gets rid of previously drawn character so you don't end up with a line of characters :PIfEnd -> ends the If statement If (G=38 And X=/1) ->if left key is pressed and not all the way to the leftThen X-1->XClrtextIfEndIf (G=37 And Y=/7) ->the next lines of code will be basically the same thing, but in accordance to up and down or YThen Y+1->YClrTextIfEndIf (G=28 And Y=/1)Then Y-1->YClrTextIfEndIf G=47 ->if exit is pressedStop -> .....well STOP! lolIfEnd
If G ->make sure to delete G at the beginning of the loop, though :PThen ClrtextIfEndX+(G=27 And X=/21)-(G=38 And X=/1)->X ->if right is pressed, X is incremented by 1, if left is pressed, X is decremented by oneY+(G=37 And Y=/7)-(G=28 And Y=/1)->Y ->same deal here, except with YIf G=47 ->this stays the same as in saintrunner's code...Then Stop ->methinks that you forgot a Then...IfEnd
If G=47Then StopIfEnd
While G=/47
G=47=>Stop
Double post ...sorta tutorial update:This version supports menu's and optimized code. A bit more complicated, but still WAYYY smaller....232 bytes including menus. Enjoy
Quote from: saintrunner on February 22, 2012, 06:03:06 pmDouble post ...sorta tutorial update:This version supports menu's and optimized code. A bit more complicated, but still WAYYY smaller....232 bytes including menus. Enjoy How did you add menus and movement in 232 bytes??