Author Topic: BatLib  (Read 145631 times)

0 Members and 1 Guest are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #345 on: April 17, 2011, 10:49:06 am »
This .8xk is the actual app. I accidentally uploaded the wrong app with all the correct documentation the first time :/

Ah! Thanks then, putting it in my calculator.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib
« Reply #346 on: April 17, 2011, 10:49:48 am »
Awesome! I am now going to see if I can make the scrolling tilemap >:D

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #347 on: April 17, 2011, 11:26:07 am »
I have this code:

Code: [Select]
dim(1,56,4
0->X
0->A
0->Y
dim(52,"7E8181818181817E",8,X,Y,0,99
getKey->A
If A=26
Then
X+1->X
End
If A=34
Then
Y+1->Y
End
If A=25
Then
Y-1->Y
End
If A=24
Then
X-1->X
End
dim(56,4
End
ClrHome

And here's how it works:



It's very weird! Y changing is soft, but X position changing isn't. Then when you hit the margins, weird things happen, please try the file it's attached.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib
« Reply #348 on: April 17, 2011, 11:29:16 am »
Scout: Sprites are drawn to 12 columns. That is why the readme says it must be a value of 0 to 11.

Also, I never added error checking there to save on speed

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #349 on: April 17, 2011, 01:27:39 pm »
Scout: Sprites are drawn to 12 columns. That is why the readme says it must be a value of 0 to 11.

Also, I never added error checking there to save on speed

yeah too bad we have 64 for Y but only 11 for X, I'll try to turn it around someway.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib
« Reply #350 on: April 17, 2011, 01:30:03 pm »
Also, unlike Axe, you can make sprites that are, say, 24 pixels wide or some other multiple of 8 (up to 96). And it is pretty fast, too, so it does have advantages :)

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib
« Reply #351 on: April 21, 2011, 02:33:24 pm »
Eh, well it isn't exactly the best time for an official update, but I will anyway... What I have updated is a small fix to command 95 and a major revision to command 54 (DBRead). Command 95 was fixed because I went to use it for Samocal and I noticed finally that it wasn't splitting the nibbles like I thought it would (I should really keep better notes on my routines instead of guessing what it does). Anyway, I literally had to remove 6 bytes of code and that was fixed. I have no clue why that code was even there XD

As for DBRead, this will prove to be very useful with the fixes and has proven very valuable for Samocal. DBRead stands for Data Base Read because its purpose is to read variables as though they are lists with variable size elements. For example, a program can be seen as a list where every element is each line of code. Obviously, each line is not always the same size and they aren't usually just numbers. That is where this command can be useful! In Samocal, for example, the monsters names are in prgmMONSTERs as follows:
Code: [Select]
:Florita
:Troll
:Dwarf
:Magfly
:Manita
:Water Demon
:Healer
:Trolm
:Bufli
And it continues. I can store this program in archive and read the lines as I need them!

Also, I would like to note that it is not necessary to read just new lines. You have to specify that you are reading between new lines by using a value of 63. If you wanted, you could read between spaces by using a value of 41 :) So anywho, here is the update.

EDIT: Also, I added the StringWidth command to tell you how many pixels wide a string is in small font and I just noticed that I left command 103 in x.x Here is the syntax for Command 103:
Code: [Select]
dim(103,SearchByte,NewByte,"VarName"
SearchByte is a value from 0 to 255 that is the byte to search for
NewByte is a value from o to 255 that is the value to replace the byte with
"VarName" is the name of the var to search and modify
I added that because I was having issues with Source Coder. It doesn't like spaces, so I had to replace all the space with another token, then when it was on my calc, I had to go back and replace everything. Anyway, it will still be very useful for a Hangman game :)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #352 on: April 21, 2011, 04:47:37 pm »
Zeda! An update! I won't install it today this time, since TI-Connect is crashing, but it's always great.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib
« Reply #353 on: April 21, 2011, 04:58:22 pm »
That's okay XD I already have added and documented two commands (103 and 104).

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: BatLib
« Reply #354 on: April 21, 2011, 08:46:09 pm »
The lessons I have learned...

Don't set all the font chars to be blank  :evillaugh:
Don't start a Recode block on the home screen   <_<
Don't forget that key codes are not the same as Basic :banghead:

The times I've cleared my ram: ∞
« Last Edit: April 21, 2011, 08:51:29 pm by mrmprog »

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib
« Reply #355 on: April 21, 2011, 09:20:53 pm »
The lessons I have learned...

Don't set all the font chars to be blank  :evillaugh:
Don't start a Recode block on the home screen   <_<
Don't forget that key codes are not the same as Basic :banghead:

The times I've cleared my ram: ∞

:D Is it bad that I gave respect for that? That actually made me laugh out loud because I learned the first one pretty fast, too XD
I should definitely make a note about the ReCode thing and while I said in the regular BatLib readme that the codes were different for dim(43, I never mentioned in the ReCode readme anything about that, so sorry x.x

Xeda112358 revises readme...

EDIT: I also noticed that I forgot to fix the Pause While command to Pause If in the readme.... Also fixing :D Thanks!

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #356 on: April 22, 2011, 11:07:44 am »
I also have infinite ram clears with recode :S

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib
« Reply #357 on: April 22, 2011, 04:15:56 pm »
I have them only from simple mistakes, but then again, I made it so I know all the tricks and limits :/

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BatLib
« Reply #358 on: April 29, 2011, 08:01:14 pm »
About the sprite display, are sprites only displayed at multiple of 8 horizontally? This might be an issue for some games where the programmer wants smooth character movement or similar things. Do you think this could be changed?

I'm glad this is still progressing regularly. :D

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib
« Reply #359 on: April 29, 2011, 11:22:58 pm »
Yes, currently I only have it with multiples of 8 (I was a big fan of using Celtic 3 before I learned assembly). That method is simply a lot faster to render and it can display sprites a multiple of 8 wide (so 64 pixel wide sprites, for example). If I make a routine that lets you display at any X coordinate, it will probably be only 8x8 sprites to begin with, and maybe eventually multiples of 8 wide.