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.
TI-Basic =>
TI-BASIC
Author |
Message |
|
dxfan101010
Member
Joined: 31 Mar 2008 Posts: 194
|
Posted: 22 Oct 2009 07:09:46 pm Post subject: |
|
|
I am making a falldown clone and i have got the main game loop workin buti cant figure out how to randomly create a wall
right now my program makes a wall "= ==== ===== ==" that looks like that scrool up the screen if anyone would help maybe with psudo-code so i can still try to do it myself? if you need me to post my whole code i will .
Thanks in advance
Zhao hui |
|
Back to top |
|
|
calc84maniac
Elite
Joined: 22 Jan 2007 Posts: 770
|
Posted: 22 Oct 2009 07:14:37 pm Post subject: |
|
|
It depends - do you always want three holes, or can it vary? |
|
Back to top |
|
|
dxfan101010
Member
Joined: 31 Mar 2008 Posts: 194
|
Posted: 22 Oct 2009 07:17:56 pm Post subject: |
|
|
anything below three is to hard anything above 5 is to easy
so if three is possible thats great but if it has to be a range than 3-5 is great
i forgot to say that has of now the wall is a string but that can change i will also need help fixing the hit detection to a random wall instead of the same wall every time |
|
Back to top |
|
|
GloryMXE7 Puzzleman 3000
Active Member
Joined: 02 Nov 2008 Posts: 604
|
Posted: 22 Oct 2009 07:23:18 pm Post subject: |
|
|
well for hit detection for now you could use
if sub(string#,Xposision,1) = "="
i took that line of code from a crappy avalanche clone i made
Last edited by Guest on 22 Oct 2009 07:27:50 pm; edited 1 time in total |
|
Back to top |
|
|
dxfan101010
Member
Joined: 31 Mar 2008 Posts: 194
|
Posted: 22 Oct 2009 07:33:48 pm Post subject: |
|
|
ok but i am still a little confused on strings this code would tell me wether the x position of my ball was above an = sign or a space right
sooo
if wall and ball are on same row and sub(string7,X,1) = "="
:Than
hit code
:elese
not hit code
end
Edit i got it to work but for my walls right now i have five strings of walls and i use a randomint to decide between them in the main loop
Last edited by Guest on 22 Oct 2009 07:39:34 pm; edited 1 time in total |
|
Back to top |
|
|
GloryMXE7 Puzzleman 3000
Active Member
Joined: 02 Nov 2008 Posts: 604
|
Posted: 22 Oct 2009 07:56:21 pm Post subject: |
|
|
if it isnt too hard could i see your code for screen movement as that might help me make my avalanche game less crappy, would make some of my other earlier programs less crappy as well |
|
Back to top |
|
|
dxfan101010
Member
Joined: 31 Mar 2008 Posts: 194
|
Posted: 22 Oct 2009 08:07:51 pm Post subject: |
|
|
yeah ill throw it into this post when i am done with dinner and surivivor is on comercial
Code: [goose]
Clearhome
1-->Y
8-->x
8--> θ
1-->t
2-->q
Delvar S
(Code for creating walls in str1 2 and 3)
repeat K=105 or Q=1
ClrHome
getkey-->k
if K≠o: θ -->T
θ-(k-24 And θ>0)+(k=26 and θ<16)-->θ
If X=0:then
8-->X
randint(1,3-->W
(this part of the code chooses a wall created above and stores it to str7)
s+1-->s
end
Output(1,t,"(space)
Output(x,y,Str7
If x=Q and sub(str7,θ,1)="="
Then
Q-1-->Q
Else
Q+1-->Q
If Q>8:8-->Q
End
Output(Q,θ,"*
Output(1,1,s
x-1-->x
end
Usual End game code
and fancey laugh at you code
[/goose]
this is not fully optimized but it will work for u to see my movement and it should work *crosses fingers* the text in () is code i left out b/c it dosent matter
Last edited by Guest on 05 Jul 2010 07:47:42 am; edited 1 time in total |
|
Back to top |
|
|
GloryMXE7 Puzzleman 3000
Active Member
Joined: 02 Nov 2008 Posts: 604
|
Posted: 22 Oct 2009 08:08:37 pm Post subject: |
|
|
thank you |
|
Back to top |
|
|
|
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