Author Topic: xLIB 84C Edition  (Read 50997 times)

0 Members and 4 Guests are viewing this topic.

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #120 on: July 30, 2013, 08:10:52 pm »
The multi-movement routines were functions where you give it your x&y variables and a step size and it will check all arrow keys and move depending on what was pressed. There was another that would also check for tile collisions as well. This means that you can move a sprite depending on what keys were pressed, and if the position it moves to is walkable in 1 real( request. It saves a lot of extra code in your program.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #121 on: July 31, 2013, 12:17:13 am »
Oh that would have been nice. For the collision, is it possible to specify dynamically where the solid tiles end in the spritesheet? For example, if I make a game where later it becomes possible to swim through water and the water tiles are placed in the middle of my sprite sheet, can I use boolean logic to offset the floor tiles starting location by 1?

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #122 on: July 31, 2013, 12:52:29 am »
The command takes a max walkable tile argument when you call it. So if you normally have tiles 0-31 and water from 32-37 then you can just set it higher later on.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #123 on: July 31, 2013, 12:59:01 am »
Ok thanks, but can the argument be something like 27+(L1(56)>13) or does it absolutely have to be a constant?

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #124 on: August 13, 2013, 05:26:17 am »
Yes that should more than fine :)

EDIT - Also i added support for xLIB BG PIC's which are small res 80x60, 256 colour images that are scaled to fullscreen. These only take up 4800 bytes and could possibly be used for simple backgrounds, titlescreens or RPG battle backgrounds etc.

Here is a demo of a few strung together:



:D.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #125 on: August 13, 2013, 05:37:40 pm »
Lol at the rickroll, but I like the small size (providing they take no ram lol). I was personally thinking about tilemap backgrounds actually, since some maps occur in the sky or stuff. But cutscenes would be nice, not to mention the size is similar to the 84+ so porting older game cutscenes wouldn't be too hard.

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #126 on: August 13, 2013, 05:50:27 pm »
Yeah, currently the pixels are 4x4 and it is a pretty low resolution image. But with the addition of colour it can be used effectively. I still need to fix a small issue with them but for the best part they are good to go.

I am still wondering about the best way to store tilemaps, im still leaning towards HEX Strings. xLIB will have some support routines to make working with string tilemaps a little easier like:

getTile - return tile at x,y in Ans
setTile - set tile at x,y in tilemap
numToStr - convert number to string in Ans
strToNum - convert string to number in Ans
moveXYCT - adjust x,y depending on keypresses and check for tile collision

Any other ideas?
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #127 on: August 13, 2013, 06:16:10 pm »
Hex strings are fine, as long as any collision detection can be done with the Gettile command. Else, string collision detection is brutally slow.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: xLIB 84C Edition
« Reply #128 on: August 20, 2013, 11:25:37 am »
Seeing this developing, I wouldn't mind play a game with 4*4 pixel if I get a decent framerate!
« Last Edit: August 20, 2013, 11:30:34 am by Eiyeron »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #129 on: August 20, 2013, 01:33:03 pm »
Actually xLIB CSE supports 8x8 pixels. Normally, such calc would use 16x16 sprites but since he uses 160x240 resolution mode (meaning 8x16 sprites) he decided to go with 8x8 sprites that are scaled up vertically. That way also, it makes it MUCH easier to port old monochrome/grayscale games, since all you have to change in graphics is adding colors.

 That still makes me wish I never lost those colorized Reuben tiles in 2005. D:

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #130 on: August 20, 2013, 10:14:09 pm »
Well the bgpic's are 4x4 pixels but you are correct about the 8x8 sprites.

Although you can draw sprites of any size, they are broken into 8x8 tiles when defining them.

I have managed to bring the code back up to speed since the data loss, and it is appropriately backed up :).

So far the list is:

Tilemap 8x8, 256 colour tiles, tiledata stored as strings
Sprites any size, clipped with transparency
Custom tile/sprite pic's, 128x64, 256 colours stored as appvars, unlimited number (custom named), can be archived
Custom 'bgpic' 80x60, 256 colours stored as appvars, unlimited number (custom named), can be archived
getTile returns tile in Ans
getKey with flexibility routines, can test for multiple keys in 1 call, can check for tile collisions etc
User variables, 256 * 16-bit variables (or memory slots) that most functions utilise (can still use TIOS for calculations etc but will need to store in a user variable for some routines)

Planned:
Text routine
Line & shape drawing
ExecuteArchivedProg (just a copy+paste from old xLIB really)
More getKey support routines
Sprite collision routine
Other stuff ...

Now that I have some basic functionality, ill see if I can make a decent test program.
« Last Edit: August 20, 2013, 10:14:49 pm by tr1p1ea »
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Re: xLIB 84C Edition
« Reply #131 on: August 21, 2013, 10:11:25 am »
Will rectangle drawing use a different routine than other shapes to save speed? Also can tilemap data (the one in appvar format) be archived and read directly from?

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: xLIB 84C Edition
« Reply #132 on: August 21, 2013, 05:31:33 pm »
Add shape collisions and transformations such as rotation and resizing :)
If you like my work: why not give me an internet?








Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #133 on: August 21, 2013, 10:24:56 pm »
Tilemap data is in strings only, there is no appvar tilemap data. I thought that this was the consensus?

What i would do is have a program containing a full map and then you can create strings from it when needed.

I can look at shape collisions and transformation/rotation etc, but that might not be until a future release :).
« Last Edit: August 21, 2013, 10:27:17 pm by tr1p1ea »
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Re: xLIB 84C Edition
« Reply #134 on: August 22, 2013, 12:49:28 am »
Wait, I thought map data was in appvar format like Axe unless in use, in which case it was string-based? ???

IIRC your goal was originally to eliminate any need for program copying (archive to RAM) and the need to split map data into multiple sub-programs to temporarily fit in RAM at all.

If it's always in string, do you think the basic data could use base-37? That way each tile takes 1 byte (0 to Theta) instead of 2 (00 to FF). D: