|
Post by Simon on Jan 18, 2005 17:11:47 GMT -5
How do we create games on a TI82?
|
|
|
Post by Simon on Jan 18, 2005 17:14:35 GMT -5
I realy want to know how to use loops. any kind of loops, and what is it for?. How to use getkey in a game ? How to make a graphiques move like the snake game? Please help me some one
|
|
|
Post by Vladik on Jan 18, 2005 18:13:48 GMT -5
Loops are for repeating (looping) something over and over again, or, alternatively, While something is happening. GetKey is just the key that the user is holding down. It is used in loops. As in: While 1 GetKey->KEY If KEY>0 Then Disp "You pressed the key" Disp KEY End end
|
|
|
Post by bfr on Jan 18, 2005 19:29:45 GMT -5
I don't know much about a ti-82 (I have a ti-86) but most BASIC games involve a group of repeated commands (again, the loop) and the "getKy" commands. Like Vladik said, getKy is the key you pressed. Eash key on the calc's keybard has a number. For example, on the ti-86, the "2nd" key's number is 21. You could say getKy->A. If you pressed the "2nd" key A would equal 21.
Also, when making a game, use getKy to your advantage. Make it so that when you press the up key, it adds one to a y varibal, when you move right, it adds 1 to an x variable. Then you could do somethiing like:
getKy->A If A ==21 Then Disp "00000" Pause End
When you press the "2nd" key, it displays "00000".
I hope this helped.
|
|
|
Post by Vladik on Jan 18, 2005 19:38:05 GMT -5
Your programming technique is inefficient... Why do getKy->A If A ==21 Then Disp "00000" Pause End
when you can do
getKy->A If A==21 Pause "00000" ?
|
|
|
Post by bcherry on Jan 18, 2005 20:16:01 GMT -5
I've never used a Ti-82, but as I understand it, it is very similar to the old Ti-83, which I do have. So I'll write down a simple program here, that you can copy onto your 82. Try to guess what it does first, and then see if you are right. Post back when you've tried it and I'll explain the code to you:
:ClrHome :ClrDraw :AxesOff :1->Z :0->W :25->X :25->Y :0->K :While K!=45 // that != is the not equals sign.... :getKey->K :If K=24:Then :0->Z:-1->W :Else:If K=26:Then :0->Z:1->W :Else:If K=25:Then :-1->Z:0->W :Else:If K=34:Then :1->Z:0->W :Else:If K=105:Then :While getKey=0:End :End:End:End:End:End :X+W->X :Y+Z->Y :If X<0:94->X :If X>94:0->X :If Y<0:62->X :If Y>62:0->Y : pxlChg(Y,X // is that right? I think pxlChg works row, column... :End :ClrDraw
OK, I think thats right. It assumes the getKey map to be the same as the 83, as well as screen dimensions. Let me know what happens.
|
|
|
Post by bfr on Jan 19, 2005 18:35:49 GMT -5
Vladik, about my inneficient ways I don't know, it's just like a tradition. I've always done the programming that way. But I may change...
|
|
|
Post by Vladik on Jan 19, 2005 20:57:04 GMT -5
Yes; you should; especially when you learn ASM; because nobody will hant to download a 60 KB program that wastes 66% of a calculator's memory just playing a simple game of Worm!
|
|
|
Post by Simon on Jan 20, 2005 7:46:06 GMT -5
why are you putting 2 = like if getkey == 21 i dont understand
|
|
|
Post by Vladik on Jan 20, 2005 17:57:40 GMT -5
In some calculators, "=" in loops is substituted by "==". I am not sure if this is the case in the TI-82 ( ), but me and bfr are assuming that it is.
|
|
|
Post by bcherry on Jan 20, 2005 21:20:06 GMT -5
It is not. I believe that is only true on the 85 and 86. For the 81-84, "=" is all you need. Simon: the reason that they use "==" instead of "=" has to do with C. In the C language, "=" is the assignment operator, the way "->" is on the calculator. So "x=2" would make x 2, rather than test if x is 2. If you want to do testing, you would use "==". On the 85/86, they decided to adopt this convention, because that is what many programmers are familiar with, yet on the 81-84 they stick with just 1 "=".
|
|
|
Post by bfr on Jan 20, 2005 21:34:55 GMT -5
Also, Simon, if you decide to get a new calc and you have 100+ dollars, get a 68k calc or if you have only 85+ dollars you can just get a ti-86/ti-86+ (good games...). Or you could just get a ti-83+ silver edition for flash memory.
I'm planning on getting a Voyage 200/ti-89 titainium sometime.
|
|
|
Post by bcherry on Jan 20, 2005 22:30:06 GMT -5
There is no ti-86+... Although I would very much support the creation of one by TI.
|
|
|
Post by Pure on Jan 21, 2005 16:23:03 GMT -5
mhuahahahaah... ;D I already have a 68k calc... ;D
|
|
|
Post by Vladik on Jan 21, 2005 16:23:46 GMT -5
Way to go, bfr! You're getting a V200! ...Only if the TI-86+ supported TI-86 games and had flash memory.
|
|
|
Post by Simon on Jan 21, 2005 18:24:11 GMT -5
I can get a 68k with only 100$ thats amazing and i can get it at wallmart ?
|
|
|
Post by Vladik on Jan 21, 2005 18:34:39 GMT -5
Well... maybe for about $130-140 you can get a 89Ti...
|
|
|
Post by bfr on Jan 21, 2005 18:38:33 GMT -5
What about a ti-87 (if there is a such thing, but I thiink there is)? I'm not sure how much that costs though... maybe someone else knows, or I could just look it up.
|
|
|
Post by bfr on Jan 21, 2005 18:46:41 GMT -5
To answer bcherry's comment, someone told me that there was, but whatever.
|
|
|
Post by Simon on Jan 21, 2005 19:35:09 GMT -5
i can buy a 68k with only 100$ wow i thought it was like 250$
|
|