Changing Background colour due to collision

fmakawafmakawa 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

  • ArmellineArmelline Member, PRO Posts: 5,354

    You can do this with an animation, I would think.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    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

  • fmakawafmakawa Member Posts: 565

    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:

    You can do this with an animation, I would think.

  • fmakawafmakawa Member Posts: 565

    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:

    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.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @fmakawa 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?

    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

  • ValanValan Member, BASIC Posts: 410
    edited March 2016

    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.

  • fmakawafmakawa Member Posts: 565

    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.

    @MentalDonkeyGames said:

    @fmakawa 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?

    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...

  • fmakawafmakawa Member Posts: 565

    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.

    @Valan said:
    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.

  • ArmellineArmelline Member, PRO Posts: 5,354

    @fmakawa said:
    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:

    You can do this with an animation, I would think.

    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.

  • ArmellineArmelline Member, PRO Posts: 5,354
    edited March 2016

    Try something like this:

    (The background colours were completely random, GS obviously just felt like a lot of green today.)

  • fmakawafmakawa Member Posts: 565

    Precisely! I love you!

    @Armelline said:
    Try something like this:

    (The background colours were completely random, GS obviously just felt like a lot of green today.)

Sign In or Register to comment.