Breakin the Grid!!

Moderator: tr1p1ea

Post Reply
User avatar
crzyrbl
Calc Wizard
Posts: 518
Joined: Wed 06 Jul, 2005 4:56 pm
Location: 3rd rock....

Breakin the Grid!!

Post 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.
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

Image
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4135
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post 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.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post 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).
User avatar
crzyrbl
Calc Wizard
Posts: 518
Joined: Wed 06 Jul, 2005 4:56 pm
Location: 3rd rock....

Post 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.
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

Image
User avatar
CDI
Maxcoderz Staff
Posts: 317
Joined: Tue 24 May, 2005 7:25 pm
Location: If I find out, you'll be first to know.
Contact:

Post 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!
Image
Image
necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

Post by necro »

um, just use masked sprites
User avatar
crzyrbl
Calc Wizard
Posts: 518
Joined: Wed 06 Jul, 2005 4:56 pm
Location: 3rd rock....

Post 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.
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

Image
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4135
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post 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.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
crzyrbl
Calc Wizard
Posts: 518
Joined: Wed 06 Jul, 2005 4:56 pm
Location: 3rd rock....

Post by crzyrbl »

ok, that makes sense
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

Image
User avatar
CDI
Maxcoderz Staff
Posts: 317
Joined: Tue 24 May, 2005 7:25 pm
Location: If I find out, you'll be first to know.
Contact:

Post 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)
Image
Image
User avatar
crzyrbl
Calc Wizard
Posts: 518
Joined: Wed 06 Jul, 2005 4:56 pm
Location: 3rd rock....

Post by crzyrbl »

I think theres alot of ways to do them.
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

Image
User avatar
dysfunction
Calc Master
Posts: 1454
Joined: Wed 22 Dec, 2004 3:07 am
Location: Through the Aura

Post 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).
Image


"You're very clever, young man, but it's turtles all the way down!"
Post Reply