Xlib Scrolling in all 4 directions.
Moderator: MaxCoderz Staff
Xlib Scrolling in all 4 directions.
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.
Any help would be appreciated just don't scream N008 and nothing else. Please give me help as long as your comments.
- 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:
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?
huh
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?
: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?
Last edited by 133794m3r on Fri 19 Oct, 2007 4:53 pm, edited 1 time in total.
- JoostinOnline
- Regular Member
- Posts: 133
- Joined: Wed 11 Jul, 2007 10:42 pm
- Location: Behind You
I suggest doing this:
The ";" only marks the beginning of comments and should not be entered in your program.
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
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.
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.
- JoostinOnline
- Regular Member
- Posts: 133
- Joined: Wed 11 Jul, 2007 10:42 pm
- Location: Behind You
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
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)
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)
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.
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.
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.
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.
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.
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.