Changing Background colour due to collision
fmakawa
Member Posts: 565
Hi Folks,
How would I change the background colour of scene upon 2 actor colliding. Crucially I need the background not just change but to expand the changing from the point of collision. Lets the current colour is green and two collide in the botton right colour. The background starts to change to the colour red. It does so by expanding from that bottom right corner until it fills the whole scene. (I get how to simply change the background, its that mechanic there that is proving problematic)
Comments
You can do this with an animation, I would think.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
You can do it with a separate actor that will be spawned to the back of the layer at the point of collision. In that actor you can have it change to the color you want, and have it change its size ("interpolate" or "change size" behavior) untill it fills the screen.
Mental Donkey Games
Website - Facebook - Twitter
What would I be animating? The background or the actors that have collided? Bare in mind that there would many actors and many collisions that can occur> @Armelline said:
Perhaps but bare in mind that there will multiple actors that can collide in many different colours. IF I spawn actor at the back of the scene. I would then have the next collision not showing since it be under an actor that will cover everything underneath it. Does that make sense?> @MentalDonkeyGames said:
If you want the background to change to the color of the actors that collide, it can be determined pretty easily by using some global attributes.
If the actor is spawned in the back of the bottom layer, it would not cover anything up.
Unless i´m misunderstanding something here...
Mental Donkey Games
Website - Facebook - Twitter
Sounds good, though the final effect may not look as nice/tidy as you intend.
What would be the time of expansion; from collision to covering the whole screen?
Would the new expansions stop the previous ones or allow them to continue?
Maybe experiment with different shapes, perhaps some with alphas.
The collision rectangle may not need to grow to fill the whole screen. Maybe a rectangle can expand, accelerates to half the screen and dies and then the background changes.
It would cover things for instance after first collision the backgrounds and changes to red. Then there is a second collision, this time blue. Blue would go under red which means you wont see the change.
like 2 seconds for the transition. the transition that comes after supercedes the one that came before. So for instance if we using layers transition 2 would be above transition 1. so by the end we only see the result of transition 2.
I intended to suggest basically what @MentalDonkeyGames said, but using a full size actor that animates from nothing to filling the screen. But what @MentalDonkeyGames said is easier - start with a tiny actor with a circle image, spawned at the location of impact, and grow it until the whole screen is covered.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Try something like this:
(The background colours were completely random, GS obviously just felt like a lot of green today.)
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Precisely! I love you!