Xlib Scrolling in all 4 directions.

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

133794m3r
New Member
Posts: 29
Joined: Sun 02 Jul, 2006 6:02 am
Location: nicksville ,VA

Xlib Scrolling in all 4 directions.

Post by 133794m3r »

Ok I was wondering how the code would look for an engine when scrolling in 2 directions. The example that's included in the documentation looks pretty good but it doesn't really help with boundary questions when using 2 directions. Like what to do if a character was at a said position. Tr1plea told me to ask my question here so I am.

Any help would be appreciated just don't scream N008 and nothing else. Please give me help as long as your comments.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Hey 133794m3r, good to see you found your way to the forums. Im having a little trouble understanding your question exactly. The example program included with xLIB can scroll in all 4 directions as well as check the map properly for tile collisions. When you say scrolling in 2 directions, do you mean like 2 directions at the same time or something different?
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
DJ_O
Calc King
Posts: 2324
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

post removed
Last edited by DJ_O on Tue 15 Jan, 2008 4:52 am, edited 1 time in total.
Image Image Image Now active at https://discord.gg/cuZcfcF (CodeWalrus server)
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Well, there are only actually 4 directions: up,down,left,right but you can combine up+left/right and down+left/right for 8 directions.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
DJ_O
Calc King
Posts: 2324
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

post removed
Last edited by DJ_O on Tue 15 Jan, 2008 4:52 am, edited 1 time in total.
Image Image Image Now active at https://discord.gg/cuZcfcF (CodeWalrus server)
133794m3r
New Member
Posts: 29
Joined: Sun 02 Jul, 2006 6:02 am
Location: nicksville ,VA

huh

Post by 133794m3r »

Ok Yeah I was talking about doing the hole you know like this for example.

:DelvarKRepeat K>24 and K<26
:getKey->K:End
:If K=24
:goto L
:If K=26
:goto R
:goto A

Like that what would I do in both of those labels to that the person could move in 2 directions. Left and Right. It's for a side scrolling game that I'm working on.

Also how do you figure out the mutiple getKey thing? :x
Last edited by 133794m3r on Fri 19 Oct, 2007 4:53 pm, edited 1 time in total.
User avatar
JoostinOnline
Regular Member
Posts: 133
Joined: Wed 11 Jul, 2007 10:42 pm
Location: Behind You

Post by JoostinOnline »

I suggest doing this:

Code: Select all

Repeat max(Ans={24,26
getkey
End
Ans→K ; Only use this line if you need to use K again later
A+(Ans=26)(A≠16)-(Ans=24)(A≠1→A ; A is the position of the character
Output(1,A,"X ; replace X with the symbol that you plan on using
The ";" only marks the beginning of comments and should not be entered in your program.
133794m3r
New Member
Posts: 29
Joined: Sun 02 Jul, 2006 6:02 am
Location: nicksville ,VA

Post by 133794m3r »

Ok thanks for that but I was talking about using Xlib for the whole thing please read the entire topic next time.
Life is filled with,:;
Error: Syntax
1: Quit
2: Goto
*presses 2*
Haha you lose.
What I don't lose.
Any way all should learn through trial and (Syntax, Domain, Range, Undefined, Lbl, Memory, No Sign Change, and your face) Error.
User avatar
JoostinOnline
Regular Member
Posts: 133
Joined: Wed 11 Jul, 2007 10:42 pm
Location: Behind You

Post by JoostinOnline »

I did read the entire topic, but as far as I can tell, you don't need xlib for this. I didn't see the point in adding xlib commands for no reason :P
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Boundaries as in "the edge of the map" or as in "collision detection of characters with certain tiles of the map"?
In either case, as far as I know it works the same way as scrolling in less directions, only applied to more directions. (though I could easily be wrong, I haven't done much with BASIC lately)
133794m3r
New Member
Posts: 29
Joined: Sun 02 Jul, 2006 6:02 am
Location: nicksville ,VA

Post by 133794m3r »

Ok I was planning on using a graphical sprite for the side scroller. Ok? It was going to be a small stick person so I need Xlib because to do it in BASIC would take an extreme amount of memory. That's why.
Life is filled with,:;
Error: Syntax
1: Quit
2: Goto
*presses 2*
Haha you lose.
What I don't lose.
Any way all should learn through trial and (Syntax, Domain, Range, Undefined, Lbl, Memory, No Sign Change, and your face) Error.
133794m3r
New Member
Posts: 29
Joined: Sun 02 Jul, 2006 6:02 am
Location: nicksville ,VA

Post by 133794m3r »

Ok I was planning on using a graphical sprite for the side scroller. Ok? It was going to be a small stick person so I need Xlib because to do it in BASIC would take an extreme amount of memory. That's why. I know how to scroll in all directions in basic but Xlib not so much.
Life is filled with,:;
Error: Syntax
1: Quit
2: Goto
*presses 2*
Haha you lose.
What I don't lose.
Any way all should learn through trial and (Syntax, Domain, Range, Undefined, Lbl, Memory, No Sign Change, and your face) Error.
User avatar
DJ_O
Calc King
Posts: 2324
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

post removed
Last edited by DJ_O on Tue 15 Jan, 2008 4:52 am, edited 1 time in total.
Image Image Image Now active at https://discord.gg/cuZcfcF (CodeWalrus server)
133794m3r
New Member
Posts: 29
Joined: Sun 02 Jul, 2006 6:02 am
Location: nicksville ,VA

Post by 133794m3r »

I guessed that it was you. And yes I promise no trolling on any other. It was just L and his noneness and such things relating with that.
Life is filled with,:;
Error: Syntax
1: Quit
2: Goto
*presses 2*
Haha you lose.
What I don't lose.
Any way all should learn through trial and (Syntax, Domain, Range, Undefined, Lbl, Memory, No Sign Change, and your face) Error.
User avatar
DJ_O
Calc King
Posts: 2324
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

post removed
Last edited by DJ_O on Tue 15 Jan, 2008 4:49 am, edited 1 time in total.
Image Image Image Now active at https://discord.gg/cuZcfcF (CodeWalrus server)
Post Reply