Discuss Scratch

Deekshan2012t1
Scratcher
54 posts

Help lol

I was trying to make a game where yo u have a background but when you lose a life it goes red and when game over, dark grey. But I want an really fast but gradual transition from the red background to the dark grey background. Here is what I have so far:
whenclicked
setlivesto3repeatuntilnotlives=0iftouchingSpikes?thenchangelivesby-1switchbackdropto-1 Lifewait0.5secsswitchbackdroptoNormal
end
iflives=0thenbroadcastGame Over

whenIreceiveGame Over
switchbackdroptoGame Over


Please reply as soon as you can, thank you!
EggDOG_MyNAME--Jeff
Scratcher
100+ posts

Help lol

You could use the block
changecoloreffectby25
Or the
setcoloreffectto100
block. Basically use these scripts:
whenclickedwaituntilLives=2repeat10changecoloreffectby10wait0.5secsrepeat10changecoloreffectby-10
You may have to look at the wiki to see the color values and adjust the scripts accordingly.
EggDOG_MyNAME--Jeff
Scratcher
100+ posts

Help lol

Also, I meant wait until lives equals 2
Repeat this for wait until lives equals 1, then for 0, don't make the color change back to normal.
Deekshan2012t1
Scratcher
54 posts

Help lol

I was thinking colour effect but how do I get the background from purple to red to grey?
EggDOG_MyNAME--Jeff
Scratcher
100+ posts

Help lol

Use the color effect values on the scratch wiki page https://en.scratch-wiki.info/wiki/Graphic_Effect
Deekshan2012t1
Scratcher
54 posts

Help lol

Saw the whole thing carefully and clearly but couldn't find what it would be.
RT_Borg
Scratcher
1000+ posts

Help lol

Hi Deekshan2012t1,

My Backdrop Crossfade tool might help. It does a nice smooth transition between images in the Backdrops sprite (which is placed on the back layer).

To use it, backpack the Backdrops sprite into your project and follow the instructions to change the costumes from what I used, and how to set a variable and broadcast when you want to crossfade backdrops. (The CROSSFADE-SMOOTHNESS variable set when green flag clicked in the Backdrops sprite controls how fast the transition is.

Tool: Backdrop Crossfade
https://scratch.mit.edu/projects/721211525/

Happy to answer any questions,

– RT_Borg

Last edited by RT_Borg (Sept. 4, 2022 19:04:52)

zomboss1_1
Scratcher
500+ posts

Help lol

Deekshan2012t1 wrote:

I was trying to make a game where yo u have a background but when you lose a life it goes red and when game over, dark grey. But I want an really fast but gradual transition from the red background to the dark grey background. Here is what I have so far:
whenclicked
setlivesto3repeatuntilnotlives=0iftouchingSpikes?thenchangelivesby-1switchbackdropto-1 Lifewait0.5secsswitchbackdroptoNormal
end
iflives=0thenbroadcastGame Over

whenIreceiveGame Over
switchbackdroptoGame Over


Please reply as soon as you can, thank you!
If all else fails, just make a bunch of backdrops that are gradually changing color till it gets to where you want it to go (very time consuming tho)
Deekshan2012t1
Scratcher
54 posts

Help lol

RT_Borg wrote:

Hi Deekshan2012t1,

My Backdrop Crossfade tool might help. It does a nice smooth transition between images in the Backdrops sprite (which is placed on the back layer).

To use it, backpack the Backdrops sprite into your project and follow the instructions to change the costumes from what I used, and how to set a variable and broadcast when you want to crossfade backdrops. (The CROSSFADE-SMOOTHNESS variable set when green flag clicked in the Backdrops sprite controls how fast the transition is.

Tool: Backdrop Crossfade
https://scratch.mit.edu/projects/721211525/

Happy to answer any questions,

– RT_Borg

Useful! Thank you so much!

Last edited by Deekshan2012t1 (May 4, 2023 18:38:06)

Powered by DjangoBB