Author Topic: BatLib  (Read 125285 times)

0 Members and 1 Guest are viewing this topic.

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 #285 on: April 06, 2011, 05:33:47 pm »
Quote from: Readme
X is the X coordinate (0~23) to draw the character or string at
:P
That is because it is displaying at (0,20)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #286 on: April 06, 2011, 05:38:02 pm »
Quote from: Readme
X is the X coordinate (0~23) to draw the character or string at
:P
That is because it is displaying at (0,20)

Meaning I can't display strings in X<20?

I can just use normal BASIC, like Text( then.

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 #287 on: April 06, 2011, 05:40:43 pm »
No, these aren't pixel coordinates XD They are like Output(, except you can draw to any row, but there are 24 columns instead of 16. Also, if you omit the coordinates, the string is drawn to the end of where the last string was drawn to XD

EDIT: Also, this doesn't use an OS font, so I only have the first 128 chars made :/

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #288 on: April 07, 2011, 09:59:09 am »
I tried this:

dim(22,"FDCB00AEC9

But the 'Done' is still there!, any idea?

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 #289 on: April 07, 2011, 12:26:17 pm »
It worked fine for me... Also, should I add that as a command?

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #290 on: April 07, 2011, 12:37:44 pm »
It worked fine for me... Also, should I add that as a command?

It actually worked now, maybe it was a problem of the whole program.

Here's the little animation you made, no problems with 'Done' here, working perfectly (uses Recode)

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 #291 on: April 07, 2011, 12:44:50 pm »
Hehe, nice :D As a few tips for optimisation, instead of AxesOff, ClrDraw, and DispGraph, inside the ReCode loop you can just do Fill(0. Also, if you want to, you can do dim(22,"FDCB00AE",40 instead of using two dim( commands :) Thanks, Scout!

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #292 on: April 07, 2011, 01:22:14 pm »
I just managed to create BatLib programs using the same engine as in Axe.

Most Axe games are based on loops:

Code: [Select]
Repeat getKey(15)
Pt-On(X,Y,Pic1
DispGraph
ClrDraw
End

Getkeys, everything is inside that.

BatLib code for it:

Code: [Select]
dim(40
Fill(0
While getKey!=15
dim(29,0,96,0,64,6
DispGraph
End
Stop

However, trying to add getKeys, I got an error:

Code: [Select]
dim(40
Fill(0
While getKey!=15
If getKey=1
Then
Stop
End                        ; I get syntax error here
dim(29,0,96,0,64,6
DispGraph
End
Stop

Any ideas?

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 #293 on: April 07, 2011, 02:49:09 pm »
Um, after the Stop, the BASIC parser picks up again :P The BASIC parser reads the next line which is End and it say "What is this?! This doesn't belong here!"

Also, you can use Line( instead of dim(29 in ReCode. It is faster that way ;)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #294 on: April 07, 2011, 02:50:49 pm »
Um, after the Stop, the BASIC parser picks up again :P The BASIC parser reads the next line which is End and it say "What is this?! This doesn't belong here!"

Also, you can use Line( instead of dim(29 in ReCode. It is faster that way ;)

Thanks much for the advice, I'll try not to let the BASIC Parser go crazy.

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 #295 on: April 07, 2011, 02:52:13 pm »
Yeah, if you need to, you can use IS>( to jump forward a specific number of lines, but that is a little advanced and complicated.

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: BatLib
« Reply #296 on: April 07, 2011, 02:54:44 pm »
does that take into account newline tokens? or individual commands?
There's something about Tuesday...


Pushpins 'n' stuff...


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 #297 on: April 07, 2011, 02:56:30 pm »
IS>( only jumps forward a number of lines, not based on the commands. So if you aren't careful, you can jump ahead to BASIC code XD DS>( is a command I like to use to make For( loops or whatnot :D  (DS>( jumps back)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #298 on: April 08, 2011, 01:06:19 pm »
IS<( works with lines indeed.

Can you make a command that jumps X tokens?

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 v4.00.95.51
« Reply #299 on: April 08, 2011, 01:21:58 pm »
I could, but I opted not to XD I figured lines were easier to count than tokens.

On another note, I am going to be late for an appointment so I need to go, but here is the newest update of BatLib. I will go into more detail later about the fixes and added stuff :)