This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Technology & Calculator Open Topic subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Community News & Discuss Nspire => Technology & Calculator Open Topic
Author Message
Dark


Newbie


Joined: 06 Jan 2004
Posts: 11

Posted: 06 Jan 2004 07:00:23 pm    Post subject:

Ok... First of all I am very new to this site... I came across it while surfing for help on how to program... It seems to be very helpful and useful... But I think I will try asking instead of searching topics

Here is my question: Ok, I am making one of those games on my calculator(Just a word one b/c I dont know... Well ill get to it) But I ran into a few bumps on the way... I have made the easy programs such as problem solvers... But i am clueless when it comes to games and creating them... Here it goes

1. How do I make it so if somone selects something it will remember it (I dont know how to make store do that)

2. How would I make a highscore list

3. Can i make a game with my calculator (Making sure its possible)

4. THis is my main question that i dont really know how to ask... How do i make a game interactive such as pac man or somthing... I can get a pic to display but i can really make it so if you press the arrow key it will move it the certian desired direction... I really need help on this


So please I am begging... Dont think of me as a newbie calculator user... Think of me as an apprentice learning the ways... Lol, anyway Help would be apprectiated if anyone has the time... I hope I came to the right site
Back to top
sgm


Calc Guru


Joined: 04 Sep 2003
Posts: 1265

Posted: 06 Jan 2004 07:33:06 pm    Post subject:

Well, first I would say that game programming is probably the most complicated area of programming (with the possible exceptions of OS's, kernels, and CAS's), so you should be sure to become acquainted with more "traditional" programming before you attempt a game.
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 06 Jan 2004 08:31:17 pm    Post subject:

I'm going to respond as best I can, but your questions are so vague it will be hard. This is all assuming you have a TI 83 or 83+.

You probably know from your past programs that the letters A through Z can be used to store numbers, and we call the letters variables. However once you get into more complicated programs (like games) you run out of variables. The best way to remedy this is with a "List." There are 6 lists that the calculator uses for graphing and memory and such. You can use them by pressing [2nd] and then a number key 1-6 (look above each number and you'll see a little yellow L1 or L2 etc). To use them, you first have to tell the calculator how big you want it to be. To do so, use dim(, found in the list ops menu (press [2nd] [STAT] [(Right)] [3]). Here is how we make "list 4" 20 variables long:

20->dim(L4)

(-> is the [STO->] key, found above the [On] button) Put that line of code in your program to set up the dimensions (how big) of L4. It might already have some numbers in it, so clear them using Fill( and putting zero's in each space.

Fill(0,L4)

Now you want to use the numbers that are in there. You can do this by telling the calculator to store a number you give it into one of the places in the List. Doing so is simple. Here's an example of storing the number 7 into the 5th position of L4.

7->L4(5)

You can also do the same thing in reverse, by placing the 5th number of L4 into another variable (we'll use variable H):

L4(5)->H

Lists are just one form of memory. There are also strings (store letters and words) and matrices (store numbers in a block) which are both commonly used in games. Look in the manual for information on these if you want, they function simalerly to lists.

I said all that stuff above because it's at the core of game design. Extra memory becomes extremely important in complex games and programs (like remembering what someone selected).

To make a high score list, you would use a list again. However you calculator often uses lists for other things, so you have to make you own list that nothing else will touch. You can call the list just about anything you want. To create a new list, simply give it the dimensions you want it to have. Here's how to create a list called HELLO, which will be 25 numbers long:

25->dim(LHELLO)

That L before the name of the list stands for list, but you can't use a normal L. Go to the list ops menu (see above) and scroll all the way to the bottom. There you will find a little L. Put that right before HELLO every time you use it. These lists that you title work just like any other list, and can be used to store high scores. Let's say you wanted to display the first number in the list HELLO, which is the high score:

Disp LHELLO(1)

It's just that simple.

#3: Yes, you can make games on your calculator (hopefully you already know that)

Phew...ok my fingers are getting tired. Anyway...how to make a game interactive. You probably already know about Input and Prompt. They ask the user of a program for a number and store it in the memory. While this is great for some programs, it's not good enough for true games. In order to get information about what key on the calculator the user has pressed, use getkey. It can be found in the program menu under I/O. Normally you use it like this:

getkey->G

G is a variable, and can be any variable you want. A number is stored into G. This number represents the last key the user pressed. Every key on the calculator has a number (with the exception of [ON]). For example, when the user presses [ENTER], 105 is stored into G because that is the number the people at Texas Instruments chose to represent Enter when they were making the calculators (I have no idea why they chose the numbers they did). Since every key on the calculator has a number, it is difficult to know what to use. Because of this the kind people at TI have made a map of them, and can be found on page 16-21 of the TI 83+ handbook. Ther four used most are the arrow keys, since they are used for games:

[Left]=24
[Right]=26
[Up]=25
[Down]=34

So how do you use this to move something (like a Pac Man) on the screen? Well as you may or may not know, the object moving on the screen is placed there by coordinates, which you probably know about from math class. Coordinates are just 2 variables that tell you where the PacMan is. If Y gets bigger or smaller, it will move up or down. If X gets bigger or smaller, it will move right or left. So here's the code for a PacMan whose coordinates are Y down and X over, and looks like an O on the screen...

(If I write //, that means I'm just making a comment, it's not part of the program)


0->G // This makes G equal to zero
2->Y
2->X // PacMan will start 2 down and 2 over on the screen
Repeat G=105 // This program will keep going until you press enter
getkey->G
If G=24
X-1->X // If the user pressed left, subtract 1 from X, moving him 1 to the left.
If G=26
X+1->X //Same as before, but now move right 1.
If G=25
Y-1->Y //Up
If G=34
Y+1->Y //Down
ClrHome // Clear the screen
Output(Y,X,"O") // Draw him on the screen!
End // This ends the block of code started by the Repeat command


There are other, faster ways to do the same thing, but I want to give you an idea.

I still can't figure out why I spent so much time on this post. Oh wait...I was bored out of my mind.

PS That program I wrote has not been tested. If it doesn't work, tell me and I'll try to fix it.


Last edited by Guest on 06 Jan 2004 08:40:34 pm; edited 1 time in total
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 06 Jan 2004 08:37:33 pm    Post subject:

also, take a look at these good tutorials

tutorials
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 06 Jan 2004 08:42:50 pm    Post subject:

Yeah that one should be done soon. Check back for an update every few weeks and it may be partially done. There are some more on the web, or you can always learn from chapter 16 of your handbook (that's where just about everyone on this site started).
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 06 Jan 2004 08:44:52 pm    Post subject:

when did this site start?
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 06 Jan 2004 08:48:21 pm    Post subject:

I meant that all of the members who post here probably started programming their calcs by reading the manual it came with.
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 06 Jan 2004 10:26:45 pm    Post subject:

Ok Dark, here's a few links to get you started. Since you've already done some programs, they may be a little too easy in the beginning.


Someone who asked a similar question (forum):
http://www.unitedti.org/forums/index.php?showtopic=556

Tips and tricks (forum):
http://www.unitedti.org/forums/index.php?showtopic=25

Lots of tutorials:
http://bgo.netfirms.com/tutorials/index.html

Also check:
http://www.ticalc.org/
Back to top
Dark


Newbie


Joined: 06 Jan 2004
Posts: 11

Posted: 07 Jan 2004 07:56:32 pm    Post subject:

Wow! That helped a lot thank you, both of you... Now it seems kinda obvious how you do some of the stuff I asked, I have no idea why I didnt know... Well again thank you, Im off to create a game... (I hope) Cya Later
Back to top
Toksyuryel
Crimson Dragon Software


Elite


Joined: 14 Jun 2003
Posts: 880

Posted: 07 Jan 2004 09:25:05 pm    Post subject:

Jedd wrote:
Every key on the calculator has a number (with the exception of [ON]).  For example, when the user presses [ENTER], 105 is stored into G because that is the number the people at Texas Instruments chose to represent Enter when they were making the calculators (I have no idea why they chose the numbers they did).

I can answer that one: think of the keys as a matrix (you know, those big useless memory hogs that newbies use for map data). Simply take the row, colomn number of the key in question and put them together. For example, the [ENTER] key is in row 10, colomn 5, and so it's number is 105. This information will come in handy when you need to know the key code of some key and you don't have time to look in the manual.

My $0.02
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 08 Jan 2004 10:05:20 am    Post subject:

Wow good point, I never realized that. Btw matrices are'nt useless, theyre an important part of any complex game. Unless you were being sarcastic.
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 08 Jan 2004 12:10:58 pm    Post subject:

They're an important part of any basic game programmed by a programmer who doesn't know how to use lists or strings.
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 08 Jan 2004 05:23:56 pm    Post subject:

but that doesnt change the fact that they are big memory hogs... :lol:

ok, 9 times <columns> times <rows> will be an approximate of how big it will be


gets huge very fast...
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 08 Jan 2004 05:56:59 pm    Post subject:

plus, you can only have 99 rows or columns. That is irritating: the only time I used matrices in my life, for a maze game, I could only do a maze with 99 nodes because the matrix couldn't be 100x4.

Quote:
9 times <columns> times <rows> will be an approximate of how big it will be

18 x rows x columns if you use complex numbers. even worse. I can only fit a 99x27 matrix on my calculator.
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 12 Jan 2004 04:47:55 pm    Post subject:

Matricies are, place for place, the same size(in terms of memory taken up) as lists
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 12 Jan 2004 05:55:25 pm    Post subject:

Arcane Wizard wrote:
They're an important part of any basic game programmed by a programmer who doesn't know how to use lists or strings.

Actually I did use a matrix once. I suppose I could have used a list, but it didn't make any real difference.

Quote:
Matricies are, place for place, the same size(in terms of memory taken up) as lists

Ah, but they do not have useful operations for them. They could be useful when used efficiently, but when a programmer just puts tons of 0s and a few 1s, it simply is a waste of space.

Instead of using a matrix, use a list. like, if you want to make a matrix R by C, create a list with RC elements. [A](A,B) you'd do L1(AC-C+B).


Last edited by Guest on 12 Jan 2004 05:55:42 pm; edited 1 time in total
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement