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
|
|
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! ) |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
|
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
|
|
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!! |
|
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: |
|
|
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 |
|
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
Babyboy |
|
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 |
|
Back to top |
|
|
|