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
ssass


Newbie


Joined: 20 Jul 2009
Posts: 10

Posted: 30 Nov 2009 10:38:56 pm    Post subject:

Hey i need help with making a simple graphic any help would be nice.
-very basic just a little straight race track
--Sorry, i had to make it quick last night...any way i just want to make a simple bird's eye view of a straight race track with a dot representing you and another one for your opponent... It is just to make the game a little more exciting and entertaining. It also needs to be possible to change the speeds of the dots according to what the car is and/or is equipped with.


Last edited by Guest on 01 Dec 2009 08:37:50 pm; edited 1 time in total
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 30 Nov 2009 10:43:31 pm    Post subject:

Bird's-eye view or first-person view?
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 01 Dec 2009 09:39:03 pm    Post subject:

I spotted your edit. Feel free to make a new post if it's in reply to a message that was made beneath yours. Otherwise, someone might have to end up looking silly with a double post like this one! (An edit won't cause a post to be marked as "unread" or go back to the "new posts" results.)

I may have overdone your image to the point where it would now require an Assembly library to draw quickly. Keep in mind that it's arranged in nice 88 blocks (I left an example 1616 region in the bottom left to demonstrate this).

[attachment=2947:overhead_track.png]

Or did you have something else in mind?


Last edited by Guest on 01 Dec 2009 09:49:27 pm; edited 1 time in total
Back to top
ssass


Newbie


Joined: 20 Jul 2009
Posts: 10

Posted: 02 Dec 2009 06:19:22 pm    Post subject:

Thanks for the Advice...
Anyway, yeah something like that. Or if that will be way too hard for a first time graphic programmer person like me just 3 parallel line across the screen would work too.
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 03 Dec 2009 06:39:29 am    Post subject:

That'd be Horizontal or Vertical.
Press 2nd -> PRGRM (so you end up in the DRAW menu) and then choose either horizontal or vertical, followed by either the horizontal or vertical coordinate. As you might know, the screen is 94 width and 62 height, so you have to choose a number between 0 and 94 for vertical and between 0 and 62 for horizontal.


Last edited by Guest on 03 Dec 2009 06:40:05 am; edited 1 time in total
Back to top
calcdude84se


Member


Joined: 09 Aug 2009
Posts: 207

Posted: 03 Dec 2009 07:48:25 am    Post subject:

That's only if your window is set like that. Horizontal and Vertical take a real number. For example, "Horizontal 5" draws the line y=5, not a line five pixels from the top of the screen
You can sort of do that if Xmin=0, Xmax=94, Ymax=0, and Ymin=-62, but then the y coordinates are negative. (i.e. you would use "Horizontal -20", not "Horizontal 20", which is off the screen)

Note: Though it is totally unrelated, this is my 100th post! Smile


Last edited by Guest on 03 Dec 2009 07:50:32 am; edited 1 time in total
Back to top
ssass


Newbie


Joined: 20 Jul 2009
Posts: 10

Posted: 03 Dec 2009 06:51:37 pm    Post subject:

So, a picture like in this program?( i made it in a few seconds so it isn't done)
How would i get a dot to move on it? And am i right in assuming that every time i would use this i would just use "recall pic"?


Code:
Pause
ClrDraw
Horizontal 30
Horizontal 40
Horizontal 50
Vertical 10
Vertical 80
StorePic 1
Back to top
ztrumpet


Active Member


Joined: 06 May 2009
Posts: 555

Posted: 03 Dec 2009 07:50:49 pm    Post subject:

That looks nice. I don't think you need to use a pic, though. You can accomplish what you want with the pxl-on/off or pt-on/off commands.
Here's a usefull link: http://tibasicdev.wikidot.com/system:page-.../tag/draw#pages
You can find links to these pages towards the bottom of the page.
Back to top
FinaleTI


Advanced Newbie


Joined: 28 Oct 2009
Posts: 81

Posted: 03 Dec 2009 09:58:00 pm    Post subject:

I've made a simple racing engine according to your request.
Feel free to use this suggestion however you wish.

You manipulate L1 to adjust the racers.
Racer delay 1 is the time it takes to add one towards racer delay 2.
If racer delay 1 is 1 and racer delay 2 is 3, then it would would run the racer delay 1 loop once and add one to the racer delay 2.
This would repeat 3 times before said car would move forward.
This is the same for racers 1 and 2.
The last digit in the list would determine if there was a chance the cars would switch odds, like racer1 delay1 would become racer2 delay1 and vice versa for delays 1 and 2.


Code:
0-->Xmin:94-->Xmax:0-->Ymin:62-->Ymax:AxesOff
ClrDraw
 Horizontal 0
 Horizontal 8
 Horizontal 16
 Horizontal 62
 Vertical 0
 Vertical 94
 Line(87,8,93,8,0
 Line(86,0,86,16
 For(_theta_,46,62
 For(Z,87+(fPart(_theta_/2)=/=0),94-(fPart(_theta_/2)=/=0),2
 Pxl-On(_theta_,Z
 End
 End
 Text(-1,2,2,"Racing
 StorePic 0
 {racer1 delay, racer1 delay2, racer2 delay, racer2 delay2, chance of switching stats-->L1
 DelVar BDelVar A
 DelVar ZDelVar _theta_
 DelVar XDelVar Y
 Text(16,2,"THE LEADER IS:
 Repeat _theta_=87 or Z=87
 Text(55,_theta_,"   / 4 spaces
 Text(47,Z,"   / 4 spaces
 RecallPic 0
 getKey-->K
 Text(55,_theta_," }
 Text(47,Z," )
 RecallPic 0
 "PLAYER   "+sub("12",2-(_theta_>Z),1
 If _theta_=Z
 "TIE                       / 23 spaces
 Text(22,4,Ans
 Vertical 94
 Vertical 0
 Repeat B >= L1(1) or A >= L1(2
 B+1-->B:A+1-->A
 End
 If B >= L1(1
 Then
 DelVarBY+1-->Y
 End
 If A>= L1(2
 Then
 DelVarAX+1-->X
 End
 If Y >= L1(3
 Then
 DelVar Y_theta_+1-->_theta_
 End
 If X >= L1(4
 Then
 DelVar XZ+1-->Z
 End
 If L1(5)=1 and randInt(1,5)=3
 Then
 L1(1-->A
 L1(3-->B
 L1(2-->L1(1
 L1(4-->L1(3
 A-->L1(2
 B-->L1(4
 End
 End
 Text(16,2,"THE WINNER IS:
 If _theta_=95 and _theta_ > Z
 Then
 Text(-1,2,2,"YOU WON!      / 8 spaces
 Else
 If Z=95 and Z > _theta_
 Then
 Text(-1,2,2,"You Lost...      / 5 spaces
 End
 End
 If Z=_theta_
 Text(-1,2,2,"TIE!!         / 11 spaces
 Pause


Edit: Forgot to define window range and added meaning of list function.


Last edited by Guest on 04 Dec 2009 06:25:56 pm; edited 1 time in total
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 04 Dec 2009 04:18:14 am    Post subject:

Well, in that case you should define the dimensions of your window before using horizontal and vertical (I'd forgotten about that).

If you want a moving dot you'll need 'Getkey' for input, 'While-loops' and 'For-loops' to keep things rolling and 'Pxl-on' and 'Pxl-offs' for the dots to appear and dissappear. If your not familiar with these thingss you probably should use a tutorial, there's quite a few around troughout the internet.

Of course, if you only want the game and don't want to learn programming yyou don\'t need to learn all that...


Last edited by Guest on 04 Dec 2009 04:19:07 am; edited 1 time in total
Back to top
ssass


Newbie


Joined: 20 Jul 2009
Posts: 10

Posted: 04 Dec 2009 08:16:37 pm    Post subject:

Thanks for the code...
How would you make it using the for( command.
I learned it, but didn't get how to do it with that dot(so I didn't really learn it, did I? Rolling Eyes )
this is my best attempt... pathetic really

Code:
0Xmin:94Xmax:0Ymin:62Ymax:AxesOff
ClrDraw
Horizontal 30
Horizontal 40
Horizontal 50
Vertical 5
Vertical 85
StorePic 1
ClrDraw
RecallPic 1
1D                    ////your car's level
1Q
4H
While 1                ///your car's side
Pxl-On(H,35)
For(H,9,94,Q
Q+DQ
C+1C
End
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 08 Dec 2009 10:03:21 am    Post subject:

Explanation of For-loops:

An example of a For-loop:

1->B
For(A,1,10,1)
AB->B
End

This is the same as calculating "10!".
It starts by changing A into 1. Then it adds 1 to A, everytime the loop reaches the End command, as long as A hasn't reached 10.
Within the loop, B is multiplied by A, so eventually B equals 1*2*3*4*.....*10.
Whenever it reaches end it jumps back to the first line after the For command.

Does that clear anything up?Razz


Last edited by Guest on 10 Dec 2009 01:04:06 pm; edited 1 time in total
Back to top
thornahawk
μολών λαβέ


Active Member


Joined: 27 Mar 2005
Posts: 569

Posted: 08 Dec 2009 11:53:15 am    Post subject:

Zero multiplied by anything is zero; it would seem that B is intended to have the value of 1 in your snippet.

But you've the right idea...

thornahawk
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 10 Dec 2009 01:02:14 pm    Post subject:

Oops Razz
Well anyways the thing was just to show what a for loop is Razz
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