So I've decided to jump on the bandwagon and start making some impressive games for the Ti-84+CSE (or not impressive, you decide) using xLibC. And of course, I have questions.
--
I just made my sprite "sheet" (picture) using gimp on a 240x160 canvas, I'm not sure which settings I should use to save it, and I'm not sure how I would go into making that saved file into a CSE picture file. Or should I make it into a appVar? Not entirely sure on this one.

Thanks for the help now, and whatever help you may give in the future.
First, you should make it on a 128x64-pixel canvas, which is the size that xLIBC expects. If you need more space, you can have up to two 128x64-pixel spritesheets loaded at a time, one at PicIndex 0, the other at PicIndex 1. Since SourceCoder 3 doesn't create xLIBC AppVars yet, save it as a PNG, go to TokenIDE's Hex Sprite Editor, open the .PNG, and save as xLIBC Tiles (or what Shaun for some reason refers to as xLIB Tiles). Make sure the color mode in the hex editor is set to xLIBC instead of OS or Celtic II before you open your PNG. Also make sure you save in all uppercase letters, like MINES1.8xv or something.
Alright, maybe someone can help me on this next part.. I made my sprites on that canvas size and saved it to a png.. However I don't have a way to use TokenIDE as shaun told me that it doesn't work with mono anymore. And in parallels it didn't work.
Well, if you post it, I can create one for you.
Alright, question time again..
I am trying to invert a square, as a selector, and it seems to only want to draw to both buffers thus creating a horrible flickering effect (from switching to the "home screen" and back. I'm just wondering if there is anyway to only draw the inverse rectangle to the second buffer?

Code:

10->A
10->B
real(0,1,1     ;xlibc half res setup
real(8,1,1     ;my attempt to make it only draw to the '1' buffer
real(7,10,A,B,8,8,1      ;start with an inverted selection of a 8x8 square
Repeat K=15    ;quit when clear is pressed
real(2,0,0)->K       ;getkey
If K≥1 and K≤4
real(7,10,A,B,8,8,1     ;if k=1-4 (arrow keys) then "erase" the inverse by reinverting the square.. this doesn't look like it work either..
A+8(K=3)-8(K=2)->A
B+8(K=1)-8(K=4)->B     ;just the general boolean getkey setup
If K≥1 and K≤4
real(7,10,A,B,8,8,1    ;inverse the new tile
end

I've tried several different ways to code it, and they all drew the inverse to both screens, help?
Thanks!

Edit: figured it out.. Guess I have to add which buffer to draw to before every draw :p oh well
The 1 at the end of all of your calls is the UpdateLCD flag, which is why it flickers. Do all your drawing, then call UpdateLCD, then do any "u drawing".
*Bump* Just wanted to make sure you saw my answer, Zelda. You don't (and shouldn't!) include which buffer to draw to every draw. Just don't pass in 1 as the update LCD flag in the calls.
merthsoft wrote:
*Bump* Just wanted to make sure you saw my answer, Zelda. You don't (and shouldn't!) include which buffer to draw to every draw. Just don't pass in 1 as the update LCD flag in the calls.
If you want to completely ignore what tr1p1ea intended the buffers to be used for, as I do in most of my xLIBC games, you can actually set the visible buffer to be the drawable buffer, and just perform all the calls with updateLCD=0. On the plus side, you don't have to juggle the contents of two buffers, but on the minus side, you can see things as they're drawn.
I have a question about tilemapping. XlibC seems to have gotten rid of the method of using an array to specify which tiles go where. How would I specify the proper tile location?
The documentation makes it clear that you should be using Strings for your tile maps.
Yeah, I get that... but how exactly would I use a string to specify where tiles go? Do I make the array and just send it to Str0? Is there a program I should be using?
Quote:
Tile data is stored in strings as hex encoded ASCII. For example, a 4x4 tilemap array (base 10 numbers):

[01,01,01,01]
[01,95,95,01]
[01,44,44,01]
[01,01,01,01]

would translate to:

"01010101015F5F01012C2C0101010101"->Str0

It's basically left-to-right, top-to-bottom from the map into the string.
Yeah, I noticed that. Perhaps I need to be more clear;

Do I need to manually type out my array into one line and then send it to Str0?

If a number on the array is "01" it would load the 1st tile in the upper left of the tile sheet, and if it were "02", it would load the second tile in the tile sheet?

Does this mean tile-based level instructions and sheets can't be stored in AppVars?
Okay, never mind: I figured out how to do tilemaps. Thank you for your assistance, Merthsoft.

I do have one more question; How does collision detection work in XlibC?
Nin68 wrote:
Do I need to manually type out my array into one line and then send it to Str0?
That is one way to do it.

Quote:
If a number on the array is "01" it would load the 1st tile in the upper left of the tile sheet, and if it were "02", it would load the second tile in the tile sheet?
Correct.

Quote:
Does this mean tile-based level instructions and sheets can't be stored in AppVars?
They can. I use appvars in BlockDude. Check out the source for more.
  
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
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement