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
United-TI Archives -> TI-Basic
 
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Author Message
Xan


Newbie


Joined: 30 May 2003
Posts: 19

Posted: 07 Jun 2003 03:31:08 pm    Post subject:

I think you look for this code:


Code:
AxesOff
ClrDraw
FnOff
PlotsOff
0->X
0->Y
Repeat K=105
getKey->K
If K
Then
Pxl-Off(X,Y
X-(K=25)(X<>0)+(K=34)(X<>94->X
Y-(K=24)(Y<>0)+(K=26)(Y<>62->Y
Pxl-On(X,Y
End
End


And there is a way to check, if pixels are turned on or not.

pxl-Test(X,Y will return 0 if the pixel is off and 1 if the pixel is on.
For the Pxl-commands the upper left corner is 0,0 and the lower right is 62,94.


You can add this to the movingcode and add some random walls to the screen:

Code:
AxesOff
ClrDraw
FnOff
PlotsOff
Horizontal Ymin
Horizontal Ymax
Vertical Xmin
Vertical Xmax
For(A,1,40
randInt(2,58->X
randInt(2,90->Y
Pxl-On(X,Y
Pxl-On(X+1,Y
Pxl-On(X+2,Y
Pxl-On(X,Y+1
Pxl-On(X,Y+2
End
1->X
1->Y
Repeat K=105
getKey->K
If K
Then
Pxl-Off(X,Y
X-(K=25)(pxl-Test(X-1,Y)=0)+(K=34)(pxl-Test(X+1,Y)=0->X
Y-(K=24)(pxl-Test(X,Y-1)=0)+(K=26)(pxl-Test(X,Y+1)=0->Y
Pxl-On(X,Y
End
End
Back to top
Smasher
I'm a llama!


Newbie


Joined: 25 May 2003
Posts: 15

Posted: 07 Jun 2003 06:49:34 pm    Post subject:

Pxl-anything starts from the upper-left corner and goes row#,col# (ie y,x, instead of x,y, though higher y's will be lower on the screen). Pt-anything, on the other hand, starts from the origin, which usually will be either the middle of the screen or the lower left corner (depending on your window settings). It follows the regular (x,y) coordinate scheme and allows you to turn on (and off) points that aren't on the screen (preventing annoying domain errors), unlike pxl-on and pxl-change.

To fix your problem just flip the x and the y, and make sure you're counting from the upper-left corner and not the lower-left.
Back to top
Smasher
I'm a llama!


Newbie


Joined: 25 May 2003
Posts: 15

Posted: 07 Jun 2003 07:29:49 pm    Post subject:

There's no good way to scroll the screen in basic, if that's what you mean by scroll. If you mean moving your character, you seem to already have the idea, judging by your earlier posts.

Pxl-Test simply tests to see if a certain pixel is on, returning 1 if it is and 0 if it is not. So if you wanted to see if the third pixel in the fifth row was on (again, counting from the upper left corner), you would go

Code:
:pxl-Test(4,2

The reason you use 4 and 2 is that the pxl- commands start counting from 0 instead of one, which I forgot to mention in my last post. So if you wanted to turn on the top-left pixel, you'd use

Code:
:Pxl-On(0,0
instead of
Code:
:Pxl-On(1,1

Also, keep in mind that the domain is 0-62 for rows (up/down), and 0-94 for columns(left/right).

What exactly do you mean by "a charecter as the move-dude "? If you mean a letter/number, use

Code:
:Text(row,column,"character
... where row and column are counted like they are for the pxl- commands, and character is the alphanumeric you want to display. Note that (for most characters) the character won't show up if the column is greater than 91, even though it will accept anything up to and including 94. Also, the row has to be 57 or less, or else it throws a domain error.

If you want a custom character... don't bother for the moment. Anything you can do will involve drawing multiple points and/or lines, and will generally slow your program down.
Back to top
Xan


Newbie


Joined: 30 May 2003
Posts: 19

Posted: 07 Jun 2003 07:37:43 pm    Post subject:

I forgot to mention another thing: All this you can find in your calculator manual.

If you don't have one for any reason, you can download it on http://education.ti.com/us/product/tech/83...ide/guides.html in many different languages.
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 08 Jun 2003 02:19:25 am    Post subject:

If you are going to make something move, it helps to make adjustable the number of pixels it moves each time.

e.g.

10 pixels, 5 pixels, 1 pixel.

Make a key that you press to toggle a variable.
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 08 Jun 2003 02:26:28 pm    Post subject:

Different people could choose how far it mooved. They could have it move the same distance each time. This would let them choose the speed.
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 08 Jun 2003 02:43:08 pm    Post subject:

babyboy wrote:
how do i stop the domain error?  and why would i want to make the charecter move different spaces each time? Also, ill take your work for the special charecter slowing down the game.

What do you mean domain error?
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 08 Jun 2003 02:55:52 pm    Post subject:

he means that when he goes off the screen using pxl-on/off/test then it gives him a domain error :
[quote name='TI-83+' date='some hour of the night']ERR:DOMAIN
1:Goto
2:Quit[/quote]
u could use something like this :

Code:
//moving code here
If A>62
62»A
If A<0
0»A
If B>94
94»B
If B<0
0»B
Pxl-On(A,B

(»=store token)
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 09 Jun 2003 01:12:51 pm    Post subject:

ok, glad i could help in some way, (if i indeed did! Laughing )
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 10 Jun 2003 08:18:12 pm    Post subject:

first of all, i would register Very Happy then dont use if statements for the walking, do something like this :

Code:
getKey->C
A+(C=34)-(C=25->A
B+(C=26)-(C=24->B
Text(A,B,"O

dont use the circle command, cause it has to stop and draw the circle (if u were using it, if not, ignore this line Very Happy )...
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 10 Jun 2003 08:19:46 pm    Post subject:

and, this :

Code:
If condition
Then
statment
End

is faster than :

Code:
If condition
statement

Very Happy
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 11 Jun 2003 01:35:25 pm    Post subject:

I REGISTERED.....YAY!! Razz
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 11 Jun 2003 01:49:03 pm    Post subject:

actually, else is a bad word for it: it is supposed to run everything after that no matter what therefore use:

if
then
code
else
if
then
code
else
if
then
...
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 11 Jun 2003 02:54:06 pm    Post subject:

Laughing I GET IT NOW!
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 11 Jun 2003 05:24:41 pm    Post subject:

um, i downloaded many ASM games and utilitys, but my favoriate is GREYPIC, but i cant get it to work, its a ASM file, but it doesen't work with mirage, and no other OS will work on my calculator, i tried ION but that doesent work and ive never heard of any others




HLP


Babyboy Laughing
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 11 Jun 2003 06:38:52 pm    Post subject:

Where did you find it?
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 11 Jun 2003 09:19:46 pm    Post subject:

The TI-ARCHIVES at ti.com i think.


but i cant get it to work Confused





Babyboy Laughing
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 12 Jun 2003 08:08:09 am    Post subject:

Make sure it is for the 83+. (what is the file extension?)
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 12 Jun 2003 01:01:54 pm    Post subject:

it ti.com archives, 83+, graphics, greypic




also, the main part of my game i have decided will be the multiplayer, buti am not sure how to go about writing a prog for it, I need to know how to save a getcalc variable to another without changing mine, i thought of the hosting player using another list, but that is so hard!




Babyboy Laughing
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
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Page 1 of 2 » All times are UTC - 5 Hours

 

Advertisement