overlap skin

Posted By: msmith2468

overlap skin - 01/11/12 02:02

I want to create a block that breaks in my game and falls
through the floor when you step on it. maybe like a cracking effect. I know i could do this with different skins that i could just rotate through to seem like an animation of the block cracking. But the problem with that is that i already have 7 different colored skins that would all need the cracking effect. if i used only 3 animation frames of cracks then i would need 21 separate skins for the effect.

I also thought about using a sprite that i could see through this way the skin on the block could remain the same and i could switch through sprite animations to achieve my effect.
the problem with this is that if i wanted my effect on all sides of the block then i would need to place sprites on all sides.

If you know of another way to do this please let me know. i guess what i was hoping for is some sort of second skin ability that i could set layers with on my model. if not then ill manage with the sprites.

Thanks
Posted By: Espér

Re: overlap skin - 01/11/12 06:12

create a second (a bit larger block). set his skin to the cracks and the texture wirh a transparent background (32bit tga + alpha channel).
now place that 2nd block at position of another to show the cracks.
Posted By: msmith2468

Re: overlap skin - 01/11/12 20:46

Ok that sounds like it should work ill give it a shot thanks.
Posted By: msmith2468

Re: overlap skin - 01/12/12 05:52

Thanks a lot it works great.
i was worried about how i was going to keep them together when they are moving but i figured it out.

i have the original block call this when its created

you = ent_create(cracks......

which places the cracks and keeps the pointer you
then every frame i set

my.x = you.x;
my.pan = you.pan;
my.tilt = you.tilt;
......

Then i have the cracks do the moving part and the original block follows.

maybe you don't care about the details.... But Thanks again!!!
© 2024 lite-C Forums