Player State Materials

Player State Materials

Aug 11, 2024

Hello warriors, if you know when players take DoubleSize PWR the paddle will change texture to BLUE, also this happens when it take SLOW PWR the paddle will change texture to RED.

But now with the Yellow PWR redesigned I had to implement a new texture but this time not when the PWR is taken, instead depending on what player chose (Golden Shoot or TripleSize) if he chose TRIPLESIZE the paddle will increase x3 and the material will change to Yellow.

Until here everything seems like works but then I encounter some problems along the way because each situation has a some seconds to stay activate (Coroutines).

So for example If I take YellowPWR and the duration is 7 seconds but after the first 3 seconds I take RedPWR then should change material to the new one.

Other scenario, if I take YellowPWR but after 3 seconds then I take DoubleSizePWR should not change material, because YELLOWPWR is has more priority over, but after 7 seconds when is deactivated if already exist the Coroutine of DoubleSize running and still has seconds remaining the should change to DoubleSize Material Blue.

This gave me some headaches to implement it , but in the end it works!

And because of this overlapping duration of each PWR I had to make a visual concept of this idea by priority colors

As you can see these are all the materials Player 1 can change (Player 2 has inverted materials of 1 and 5)

  • Inverse: Apply material of the opponent (green or pink) + Inverse controls of the player

  • Slow Speed: Apply red material + reduce speed 50%

  • TripleSize: Apply yellow material + increase size by x3

  • DoubleSize: Apply blue material + increase size by x2

  • Default: This material is applied when every other effect has ended ( P2 has pink instead)

So In the image I made you see the overlapping duration but then should show always by priority.

Video is coming soon!

Vous aimez cette publication ?

Achetez un café à Spirit Warrior

Plus de Spirit Warrior