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 TI-BASIC 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. TI-Basic => TI-BASIC
Author Message
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 28 Feb 2004 05:40:42 pm    Post subject:

I now know how to scroll the graph screen, but if I wanted to draw a map of the world what would I save it to or how would I draw it in order to get it all onto one screen to scroll? I want to be able to do something like this application HERE
Back to top
DigiTan
Unregistered HyperCam 2


Super Elite (Last Title)


Joined: 10 Nov 2003
Posts: 4468

Posted: 28 Feb 2004 06:02:42 pm    Post subject:

That's a tricky one. You'd definatly do it through the use of offsets (this essentially what longitutde and lattitude do for flat cartesian maps.) Since you're dealing with a world map, I'm assuming you'd also like that map to loop constantly and scrool freely in either direction. Since your map is 1 screen lenght you could "rotate scroll" left and right using combinations of the RL (HL), RR (HL), SLA (HL), and SRA (HL) commands for smooth-shifting. Verticle scrolling could be done using LDIR methods. Longitude and Latitude could be used as shift counters for saving purposes.
Back to top
X1011
10100111001


Active Member


Joined: 14 Nov 2003
Posts: 657

Posted: 28 Feb 2004 06:43:36 pm    Post subject:

I think he means in basic, this is the basic forum after all.
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 28 Feb 2004 06:49:46 pm    Post subject:

There arent very many games in Basic that can scroll. Take a look at Civilization Simulator if you really want to, but that game sucks. I think all you do is draw something on the graph screen, then change the window vars, then re-draw it again. It takes forever and is not worth the wait, so avoid scrolling in Basic at all costs.
Back to top
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 28 Feb 2004 07:05:27 pm    Post subject:

I really need to do this, because I'm making a risk game and with the size of the screen scrolling is nessesary. I can get the screen to scroll left and right but it takes forever to get the cursor from one side to the other and I don't know how to do it up and down.
Back to top
X1011
10100111001


Active Member


Joined: 14 Nov 2003
Posts: 657

Posted: 28 Feb 2004 11:56:46 pm    Post subject:

How do you do it left and right?
Back to top
DigiTan
Unregistered HyperCam 2


Super Elite (Last Title)


Joined: 10 Nov 2003
Posts: 4468

Posted: 29 Feb 2004 12:22:34 am    Post subject:

Quote:
I think he means in basic, this is the basic forum after all.

Sorry about that. I get in the habit of clicking the "Active Topics" link and overlooking the thread type. But regardless, if you're using a global map with cartesian-type offsets (ie longitute, latititude), you'll have to impliment an offset system in your mapping code...

PIC Mapping

I wouldn't really suggest using a PIC map because of their inflexibility. PICs are nice for titlescreens and other still images, but they come up short whenever scrolling is required. Shifting would be accomplished using combinations of the pxl-test and pxl-on/off commands (Very, very slow).

Matrix Mapping

By using a list or matrix as a bitmap you'd gain more control over what map portions are drawn where. If you use a matrix, your map offsets refer to row/columns of the matrix image.
Back to top
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 29 Feb 2004 09:46:34 am    Post subject:

Delvar Y1
ZStandard
Clrdraw
"94"->Y1
RecallPic1
Trace

Thats how you get it to scroll left and right.

How would drawing a map in a matrix work?


Last edited by Guest on 29 Feb 2004 09:50:28 am; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 29 Feb 2004 11:21:43 am    Post subject:

Newbie wrote:
Delvar  Y1
ZStandard
Clrdraw
"94"->Y1
RecallPic1
Trace

Thats how you get it to scroll left and right.

How would drawing a map in a matrix work?

That would not work. Either after you do Trace or after you trace offscreen, the picture will be cleared.
Back to top
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 29 Feb 2004 11:34:52 am    Post subject:

How do you get it to scroll left right up down and not have it clear?
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 29 Feb 2004 12:13:44 pm    Post subject:

Redraw everything.

ClrDraw
AxesOff
..etc
0->Xmin:94->Xmax
0->Ymin:63->Ymax
For(X,1,20,4 //create some random lines
randInt(0,94->L1(X
randInt(0,63->L1(X+1
randInt(0,94->L1(X+2
randInt(0,63->L1(X+3
End
Repeat K=45
getKey->K
Xmin-(K=24)+(K=26->Xmin
Xmax-(K=24)+(K=26->Xmax
Ymin-(K=34)+(K=25->Ymin
Ymax-(K=34)+(K=25->Xmax
If K:Then
For(X,1,20,4 //draw all the lines stored to L1
Line(L1(X),L1(X+1),L1(X+2),L1(X+3
End
End
End


Last edited by Guest on 29 Feb 2004 12:14:33 pm; edited 1 time in total
Back to top
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 29 Feb 2004 12:32:57 pm    Post subject:

So after everytime you draw a line ina program you would store it to L1?
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 29 Feb 2004 12:47:17 pm    Post subject:

No, it's just an example of how you could use a list to store lines in and have something to know where to redraw them.

There's no point in storing the same value's in L1 every game cycle.


Last edited by Guest on 29 Feb 2004 12:47:43 pm; edited 1 time in total
Back to top
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 29 Feb 2004 12:59:13 pm    Post subject:

After drawing all the lines in a program how would you store every line to L1?
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 29 Feb 2004 01:02:13 pm    Post subject:

Well, you'd need pixeltest, and you'd end up with a huge list with every pixel stored in it, since you can't really tell if something's a line or not.

You should store them while drawing, just get the coordinates from the vars, and put those in a list.
Back to top
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 29 Feb 2004 01:15:37 pm    Post subject:

So there is no way to amke the scrolling go faster?
Back to top
DigiTan
Unregistered HyperCam 2


Super Elite (Last Title)


Joined: 10 Nov 2003
Posts: 4468

Posted: 29 Feb 2004 09:19:00 pm    Post subject:

If there is, it hasn't been documented.
Back to top
Ray Kremer


Member


Joined: 16 Feb 2004
Posts: 237

Posted: 01 Mar 2004 07:53:09 pm    Post subject:

Since it's basic, probably the best thing is to not use actual scrolling but just create enough individual views to cover the entire game board. Something like using the page down key to go through a web page instead of the down arrow.
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