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 Your Projects 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. Project Ideas/Start New Projects => Your Projects
Author Message
El Jaque


Member


Joined: 01 May 2008
Posts: 122

Posted: 23 May 2008 02:31:56 pm    Post subject:

okay, i was just fiddling around with my calc and i decided to make some sort of gravity/movement engine in BASIC, and i came up with the idea to make some sort of a sideways rock climber variation (with gravity). Cool
here's the code for the gravity + movement engine, it looks ok i guess, of course it is a little flickery and there is some delayed response time, if anyone can think of ways to improve it, it would make this game a lot nicer! Thanks (by the way, the ship wont be a "theta", im just using that as an example)!!!


Code:
:ClrDraw
:48->M
:45->N
:Text(-1,56,0,"XXXXXXXXXXXXXXXX
:While 1
:Text(-1,M,N,"theta
:getKey->K
:If K=24 and N "doesn't equal" 0:Then
:Text(-1,M,N,"one space
:N-5->N
:End
:If K=25 and M>1:Then
:Text(-1,M,N,"one space
:M-6->M
:End
:If K=26 and N "doesn't equal" 90:Then
:Text(-1,M,N,"one space
:N+5->N
:End
:If K=34:Then
:Text(-1,M,N,"one space
:If M<48
:M+8->M
:If M "greater than or equal to" 48
:48->M
:End
:If K<105 and M "doesn't equal" 48:Then
:For(X,1,50
:End
:Text(-1,M,N"one space
:M+1->M
:End:End


there it is... its not much but it does the job (i hope)...
thanks!
Back to top
vuurrobin


Advanced Member


Joined: 09 Aug 2006
Posts: 428

Posted: 23 May 2008 04:12:41 pm    Post subject:

you might want to learn about boolean logic, since you can optimise this a lot using that.

http://tibasicdev.wikidot.com/piecewise-expressions

(no idea why it's called piecewise expressions)
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 23 May 2008 04:49:19 pm    Post subject:

vuurrobin wrote:
you might want to learn about boolean logic, since you can optimise this a lot using that.

http://tibasicdev.wikidot.com/piecewise-expressions

(no idea why it's called piecewise expressions)
[post="123965"]<{POST_SNAPBACK}>[/post]
Two reasons: it's the term the manual uses, and "Boolean logic" is an ugly and inaccurate name.
Back to top
TheStorm


Calc Guru


Joined: 17 Apr 2007
Posts: 1233

Posted: 23 May 2008 05:38:29 pm    Post subject:

DarkerLine wrote:
vuurrobin wrote:
you might want to learn about boolean logic, since you can optimise this a lot using that.

http://tibasicdev.wikidot.com/piecewise-expressions

(no idea why it's called piecewise expressions)
[post="123965"]<{POST_SNAPBACK}>[/post]
Two reasons: it's the term the manual uses, and "Boolean logic" is an ugly and inaccurate name.
[post="123967"]<{POST_SNAPBACK}>[/post]

Well they are called Boolean by the 86 manual so I don't think TI has a set standard for the terminology.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 23 May 2008 10:01:41 pm    Post subject:

TheStorm wrote:
DarkerLine wrote:

Two reasons: it's the term the manual uses, and "Boolean logic" is an ugly and inaccurate name.
[post="123967"]<{POST_SNAPBACK}>[/post]

Well they are called Boolean by the 86 manual so I don't think TI has a set standard for the terminology.
[post="123969"]<{POST_SNAPBACK}>[/post]
Not quite. "Boolean operators" are used to denote what could be called "logical operators" on the calculators that have a boolean (true/false) variable type (86, 89, and othes); this is standard terminology in those cases. The use of true/false results encoded as 1 and 0 in optimization (which, incidentally, is impossible on the same calculator models) is never referred to by this name.

In fact, the concept is mentioned in the TI-83+ guidebook once, under the heading "Graphing Piecewise Functions". A similar section is present in the TI-82 guidebook, and on any other calculator where the idea applies. When writing the TI|BD page, I changed the name to "piecewise expressions" because, in general, these are not functions.

Now if we'll leave the discussion of terminology for a moment and discuss the program at hand?

It might be useful to add a loop to wait and do nothing until some key is pressed: this will avoid going through the loop each time, and improve responsiveness when a key is pressed. Instead of just a simple getKey→K you'd do Repeat Ans:getKey→K:End.


Last edited by Guest on 02 Aug 2010 01:59:43 am; edited 1 time in total
Back to top
vuurrobin


Advanced Member


Joined: 09 Aug 2006
Posts: 428

Posted: 24 May 2008 05:27:18 am    Post subject:

he can't add another loop since gravity would stop working then.
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