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
Bhaliar


Member


Joined: 16 Nov 2009
Posts: 221

Posted: 23 Nov 2009 12:30:22 pm    Post subject:

Aight, I have found a new problem with a game I want to make. I would like to try and make a game that consists of a panel, a ball and a hole, and you have to keep bouncing the ball around until it goes in. But I have no idea how to create randomised trajectory angles. Any help?
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 23 Nov 2009 01:40:26 pm    Post subject:

You have two speeds, one is probably constant (unless you want to use gravity) which is the speed in the vertical direction, first the ball goes up, then it goes down again.
You also have a horizontal speed. Depending on how you want to move your ball you might make it completely random (so the ball will just go left one turn, then right the next for example), or you can give it a certain speed, and add a small random amount to it. If you use pxl-on for the ball, you gotta remember to use Ipart for the coordinates though.

I hope I was clear enough... If not, if it's not to much effort, I'll type out my own bounce game :P

Clrdraw
30->A
Pxl-on(A,1
Pxl-on(A-1,1
Pxl-on(A+1,1
31->B
2->C
Pxl-on(B,C
Axesoff
1->E
0->G
.1randint(-5.5->F
.07->H
While 1
0
While Ans=0 and C!=1
Pxl-on(iPart(B +F),C+E
Pxl-off(ipart(B ),c
C+E->C
B+F->B
If pxl-test(iPart(B ),C+E)+(C=10
Then
-E->E
G+1->G
If not(fPart(G/10
H+0.03->H
End
If C=2
HranInt(-5,5->F
Getkey
End
If C=1:Then
Clrhome
Stop
End
(ans=34)-(ans=25
pxl-on(a+2Ans,1
Pxl-Off(a-2ans,1
A+Ans->A
End
End

Okay, I typed my stupid little bounce-game anyways -.-


Last edited by Guest on 23 Nov 2009 03:34:07 pm; edited 1 time in total
Back to top
kinkoa


Member


Joined: 28 Jul 2009
Posts: 103

Posted: 23 Nov 2009 02:30:27 pm    Post subject:

what are the smileys representing
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 23 Nov 2009 03:34:16 pm    Post subject:

Corrected.
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