http://calcg.org/newlogo2.png Not Logged in.
Login | Register

General Discussion Board \ Calculator Discussion \ Maps?

Click here to log in (you must be logged in to post comments).

AuthorComment
SamFisher1022
Probe
avatar
Posted: 4 Sep 2006
10:16 GMT
Total Posts: 4
I'm trying to make an RPG but I don't know how to make map screens, particularly by using the "getKey" command. Can anyone help?

---
Those who don't learn from history are doomed to repeat it. The same holds true for the rest of your classes.
threefingeredguy
Ghost
avatar
Posted: 4 Sep 2006
10:23 GMT
Total Posts: 1189
Well, you are being pretty vague. Perhaps you could tell us a specific problem.

---
Someone call for an exterminator?
SamFisher1022
Probe
avatar
Posted: 4 Sep 2006
10:38 GMT
Total Posts: 4
I can't use the "getKey" command correctly. When the map displays, I can't move around the screen when I press a button.
In games like Age of Darkness 2 (my favorite so far), I can move around maps by pressing the arrow buttons. But I can't figure out how to program that myself.

---
Those who don't learn from history are doomed to repeat it. The same holds true for the rest of your classes.
haveacalc
Guardian
avatar
Posted: 4 Sep 2006
10:57 GMT
Total Posts: 1111
This his how getKey works:
In BASIC programs, keypresses are detected automatically. All getKey does is stores the pressed key to Ans and resets it, allowing a new key to be pressed. The most recent key to be pressed before getKey is the one stored.
You can use it like this to move something around the screen:

A = row
B = column
C = getKey
D = previous row
E = previous column


1->A
1->B
1->D
1->E
ClrHome
Repeat C=105
Output(D,E,"
Output(A,B,"O
A->D
B->E
getKey->C
A-(C=25)+(C=34->A
B-(C=24)+(C=26->B
End
DelVarADelVarBDelvarCDelvarDDelvarEClrHome



A number corresponds with each key on the calculator. As you can see from the example, it's a good idea to put off getKey until right before you will use it, leaving as much time as possible for the user to press a key.


I like to use strings for maps, having one character for each tile. Come back after you're fairly adept with strings (or ask about it here), but I don't have time to say much more about this.

---
-quoted directly from most movies that don't exist (and some that do).
Liebe ist Krieg
Wraith
avatar
Posted: 4 Sep 2006
15:07 GMT
Total Posts: 542
in your calc book that came with it, there is a getkey map for your calc. each number corresponds to the key, and they move numerically down the row. pretty simple. use those numbers, and Haveacalc's post to help you make one of your own.

---
~~~~LiK~~~~
haveacalc
Guardian
avatar
Posted: 4 Sep 2006
15:08 GMT
Total Posts: 1111
It's true.

---
-quoted directly from most movies that don't exist (and some that do).
SamFisher1022
Probe
avatar
Posted: 7 Sep 2006
14:04 GMT
Total Posts: 4
Figures. I never read manuals... Thanks for the tips.

---
Those who don't learn from history are doomed to repeat it. The same holds true for the rest of your classes.





Portal | My Account | Register | Lost Password or Username | TOS | Disclaimer | Help | Site Search | File Archives Copyright © 2002-2019 CalcG.org