Page 1 of 1

Breakin the Grid!!

Posted: Sat 08 Jul, 2006 5:11 am
by crzyrbl
A lot of the xLib games out there (especially my zelda game unfortunately) are very "griddy." By that I mean the screen looks like just a bunch of squares. Dont get me wrong, it's great if you want to do say...Tetris, but some games can do without. I want to make a game where a 12x12 characters are on a 8x8 tilemap that flows well. The problem is, Im not sure how to do it right now. Obviously I want to use real(1, but the width has to be a multiple of 8 and I dont know how to get around that. 16x16 would be way too big, and even if it was used, the game would still have that grid.

Posted: Sat 08 Jul, 2006 10:00 am
by tr1p1ea
You would just draw a 12x12 sprite in the space of a 16x16 sprite. Your movements/collision code should take of the rest.

Ill make a small demo for you soon.

Posted: Sat 08 Jul, 2006 4:23 pm
by kalan_vod
Yeah, like tr1p said. You would just need a nicely modified detection routine, which would allow you to walk closer to the tiles or w/e. You could either put the character in the center of the 16x16 square (which I would do) or off center. I would make some sort of sample, but since the master himself is going to I will not :P (saves me work XD).

Posted: Sun 09 Jul, 2006 1:20 am
by crzyrbl
Its not the detection im worried about right now. That can be done pretty easily. Im afraid it will mess up the background with the extra space, even if it is centered.

Posted: Sun 09 Jul, 2006 2:05 am
by CDI
not if it is blank space, and you OR a base and XOR something to make the base into a sprite, effectivly adding it to the BG, then using REAL(3 to reload the BG (providing you had used REAL(9 beforehand) to erase the sprite and replace it!

Posted: Sun 09 Jul, 2006 4:30 am
by necro
um, just use masked sprites

Posted: Mon 10 Jul, 2006 4:15 am
by crzyrbl
whats the fastest way to do sprite masking. I was thinking instead of messing with the entire pic, doing
1. -or- the base
2. -xor- the same base to create the hole
3. -xor- the actual sprite

then i thought i could just combine #2&#3 by just using -and- on the sprite altered to have a black-filled bg in the sprite sheet instead of a white one.

Posted: Mon 10 Jul, 2006 5:01 am
by tr1p1ea
You have 2 sprites, 1 is your actual sprite, the other is your mask. With your mask, any areas which you wish to be shown as see-through/transparent you would draw as black. Any areas which would be taken up by your sprite would be white. Then you would AND the MASK, followed by an OR of the SPRITE.

Posted: Mon 10 Jul, 2006 3:31 pm
by crzyrbl
ok, that makes sense

Posted: Mon 10 Jul, 2006 4:49 pm
by CDI
necro wrote:um, just use masked sprites
that is pretty much what I described, but in detail in case he didn't know how (my methodology may be a bit off because I haven't done xLIB work like that since March)

Posted: Mon 10 Jul, 2006 10:18 pm
by crzyrbl
I think theres alot of ways to do them.

Posted: Fri 14 Jul, 2006 3:08 am
by dysfunction
What I used to do with Omnicalc (yep, I'm pretty sure I did the first ever BASIC sprite masking) is OR the mask/base, then XOR it, then OR the sprite. Omnicalc didn't have an AND sprite feature. With Xlib, all you need to do is AND the mask, then OR the sprite (XORing the sprite works just as well).