Bennu Game Development

English Forums => Helpdesk => Topic started by: MisterN on November 19, 2011, 10:52:43 PM

Title: can i use a mask for objects (for colliding)?
Post by: MisterN on November 19, 2011, 10:52:43 PM
if any of you have ever used game maker, then im sure you know what the mask is. Any collisions are delt with, with the mask (and not the sprite). Is there a way to do a mask in bennu? For I bet that would make collisions alot better looking lol.
Title: Re: can i use a mask for objects (for colliding)?
Post by: SplinterGU on November 19, 2011, 11:49:21 PM
it was an idea that I had time ago... not yet available... but in the future maybe.

collision mask exists since ZX-Spectrum time.
Title: Re: can i use a mask for objects (for colliding)?
Post by: MisterN on November 20, 2011, 12:54:04 AM
so theres no current collision mark system? otherwise the character will sometimes stick into things and float. with collision marks isntead, itll all be k.
Title: Re: can i use a mask for objects (for colliding)?
Post by: SplinterGU on November 20, 2011, 01:06:07 AM
you can use a ghost (of your visible character) collision process with a mask graph and alpha=0...
Title: Re: can i use a mask for objects (for colliding)?
Post by: MisterN on November 20, 2011, 01:45:34 AM
example please?
Title: Re: can i use a mask for objects (for colliding)?
Post by: SplinterGU on November 20, 2011, 02:18:25 AM
2 process... 2 graphs (1 for the character, 1 for the mask)... same coords x and y... you can use z for put on the mask's process behind the character's process... and you need define the alpha of the mask's process to 0 (zero)... your collision instead of collide with the character's process must collide with mask's process... it is all folk...

very easy.
Title: Re: can i use a mask for objects (for colliding)?
Post by: MisterN on November 20, 2011, 02:57:07 AM
im confused :S
Title: Re: can i use a mask for objects (for colliding)?
Post by: SplinterGU on November 20, 2011, 03:08:24 AM
really? sorry, I'm real sorry... maybe some other guy can you explain better than me... please, excuse me...
Title: Re: can i use a mask for objects (for colliding)?
Post by: gecko on November 20, 2011, 03:54:00 AM
it's exactly as splinter said.

You have your normal process, with your normal graph. Then you create a second process with the graph that you want to use as a collision mask, an alpha value of 0, and make it follow the other process every frame. Then you manage the collisions with this second process, that's all.
Title: Re: can i use a mask for objects (for colliding)?
Post by: SplinterGU on November 20, 2011, 04:29:20 AM
I forget say... alpha=0 will make the process invisible.