Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => Topic started by: SuperSmashcz on December 19, 2006, 01:38:00 pm

Title: Screen Moving With Person
Post by: SuperSmashcz on December 19, 2006, 01:38:00 pm
Ok, my next  challenge, to get the screen to move when the "character" goes outside of the screen. How do i do this? Ive looked at the demo that came with xlib, but i cant figure it out  :banghead:banghead.gif
any help?
Title: Screen Moving With Person
Post by: Halifax on December 19, 2006, 05:04:00 pm
Hmm you know maybe you should try studying other code or trying it by writing down what exactly needs to happen. Not to be rude but it's like you want us to make the game for you. That's just me
Title: Screen Moving With Person
Post by: bfr on December 19, 2006, 05:29:00 pm
I don't even use xLib, and I have an idea how to solve this.

Simply adjust the portion of the map displayed and the character's position.  For example, if the character is all the way at the right side of the screen, store 1 or whatever to its position, and make it so that xLib renders the tiles starting from the location of the map plus 12, if it uses tiles (96=column width in pixels, 8=width of tiles, 96/8=12).  

I at least know that xLib uses the real() function to pass commands.  So, I highly doubt that this is how xLib renders maps, but let?s say the map data is stored in a giant matrix, and xLib uses real(startRowTile,startColumnTile,matrixwithData).  Increase the startColumnTile parameter by 12.  Just for clarification, startRowTile would be the first row of the matrix containing the data that xLib would render and startColumnTile would be the first column that xLib would render.    

Did that help, or are you even more confused now?  :Ptongue.gif
Title: Screen Moving With Person
Post by: SuperSmashcz on December 20, 2006, 09:00:00 am
Well, im very new to xlib, and id liek some code suggestions, if possible..or hints, cuase theres like nothing here for new people, its like your expected to understand it  :(sad.gif
Title: Screen Moving With Person
Post by: Floodkiller on December 20, 2006, 10:26:00 am
If you don't understand xLib, then you should read some tutorials on some more complicated BASIC coding before attempting to do a lib-assisted program.  Most of the stuff that you learn using more advanced BASIC is going to carry over to xLib, such as matrix level detection (or more complicated stuff), or sprite moving, or tilemapping.  If you don't understand how to do it with ASCII graphics, it will be even harder to learn it with xLib.
Title: Screen Moving With Person
Post by: bfr on December 20, 2006, 11:04:00 am
http://xlib.revsoft.org

I know that xlibman (notice his username) and many others here are good with xLib.  
Title: Screen Moving With Person
Post by: Spellshaper on December 20, 2006, 11:24:00 am
QuoteBegin-bfr+20 Dec, 2006, 23:04-->
QUOTE (bfr @ 20 Dec, 2006, 23:04)
I know that xlibman (notice his username) and many others here are good with xLib.  

 wield xLib as you would a brush, pen, cheesecake, or any other weapon of choice.

I would recommend you to learn as many quirks of TI-BASIC first, so you can max xLibs power and speed.
It can do truly amaziung things, but wrong inputs do have the possibility to yield unexpected results ( like crashes ._. ) me likeees backups.
Title: Screen Moving With Person
Post by: Radical Pi on December 20, 2006, 12:19:00 pm
You want the screen to scroll when the whatever-you-control (if its an RPG I'm not assuming its a person :Ptongue.gif) gets to the edge? That's tough from a beginner perspective. Let's see what I remember from when I did it...

I did it with plots, and changed the window when your plot approached X/Y Min/Max.

Put that in terms of xlib and you're good.