Bennu Game Development

English Forums => Helpdesk => Topic started by: BlackCurtain on January 23, 2012, 09:57:04 AM

Title: map_block_copy
Post by: BlackCurtain on January 23, 2012, 09:57:04 AM
I want to make a 3D looking block to be used as rotating doors for my platform game, and I've been told that map_block_copy can give me the desired effect. Unfortunately the documentation doesn't explain this function very well in detail, so what I'm wondering is how I would use the map_block_copy to create 3D looking block object that can revolve like a door in a 2D view?
Title: Re: map_block_copy
Post by: handsource-dyko on January 23, 2012, 12:34:37 PM
maybe map_xputnp() is more suitable. It's the most advanced blitting function, since the destination and target graphs can be from different fpg's. In the other functions, the graphs have to be in the same fpg. This function also has scaling properties.
Title: Re: map_block_copy
Post by: BlackCurtain on January 23, 2012, 12:43:03 PM
Then I would have to use 2 graphics processes right? One for the side of the door and one for the front of the door.
Title: Re: map_block_copy
Post by: handsource-dyko on January 23, 2012, 03:55:57 PM
Not necessarily, you can change the graph of a process at runtime.
Title: Re: map_block_copy
Post by: FreeYourMind on January 23, 2012, 04:27:57 PM
I told you, use expand mod it's easy, another way more easy, and for your propose is suficient:

Use a uniform color door (or texturized but with left side = right side texture), imagine the door is closed, you have 2 graphics/process, the body door graph/process, and the door side process, at the begining you have:

Example, player move from left to right:

At begining the door is closed:

1 - Door body process (80 x 50 pixels):

size_x = 0;
size_y = 100;

x = 100;

2 - Side door process (10 x 50 pixels):

x = 100;
z = - 1;



When your player colide with the door (or is closer to the door),
you change the door variables:

1 - Door body process (80 x 50 pixels):

size_x++;
if (size_x >= 100) size_x = 100; end

// This expand the door graphic from the center to the sides, so, to fix the position, in conjuntion with that, you need to correct horizontal position, you need to increment x (x++), you move the XX to 'FIX' the door at the wall engage.

2 - Side door process (10 x 50 pixels):

x++ // (or another value, you need to test and fix correct increment)

With this you can do a fast and nice effect, because you use small doors this way it's suficient and very effective
Title: Re: map_block_copy
Post by: BlackCurtain on January 23, 2012, 04:31:54 PM
Quote from: FreeYourMind on January 23, 2012, 04:27:57 PM
I told you, use expand mod it's easy, another way more easy, and for your propose is suficient:

Use a uniform color door (or texturized but with left side = right side texture), imagine the door is closed, you have 2 graphics/process, the body door graph/process, and the door side process, at the begining you have:

Example, player move from left to right:

At begining the door is closed:

1 - Door body process (80 x 50 pixels):

size_x = 0;
size_y = 100;

x = 100;

2 - Side door process (10 x 50 pixels):

x = 100;
z = - 1;



When your player colide with the door (or is closed to the door),
you change the door variables:

1 - Door body process (80 x 50 pixels):

size_x++;
if (size_x >= 100) size_x = 100; end

// This expand the door graphic from the center to the sides, so, to fix the position, in conjuntion with that, you need to correct horizontal position, you need to increment x (x++), you move the XX to 'FIX' the door at the wall engage.

2 - Side door process (10 x 50 pixels):

x++ // (or another value, you need to test and fix correct increment)

With this you can do a fast and nice effect, because you use small doors this way it's suficient and very effective
Yes I had a look at the mod_expand but it looked a bit overkill. This method seems much simpler though, I will try it :)