Discuss Scratch

parq
Scratcher
7 posts

Get background to change when two sprites touch

Hi community,
I'm working on a project on scratch and I'm trying to get a backdrop to change when two sprites on screen touch each other. I've coded the backdrop to change and each sprite as well but it doesn't seem to work. I've been using broadcast to try to get it done with no luck. I think I'm missing something. Can someone help me out?

Note: I'm a starter with no previous experience with programming.

Thanks in advance,
powercon5
Scratcher
1000+ posts

Get background to change when two sprites touch

in one sprite put

whenclickedforeveriftouchingsprite 2?thenswitchbackdropto2
parq
Scratcher
7 posts

Get background to change when two sprites touch

Hi powercon5,

i tried your solution but it didnt work for me.
i currently have these blocks on my sprite (cant upload a pic atm):

when backdrop switches to <1>
show
if <touching clock> then
switch backdrop to <2>
else
forever
show
go to <mouse pointer>
hide

thanks
powercon5
Scratcher
1000+ posts

Get background to change when two sprites touch

parq wrote:

Hi powercon5,

i tried your solution but it didnt work for me.
i currently have these blocks on my sprite (cant upload a pic atm):

when backdrop switches to <1>
show
if <touching clock> then
switch backdrop to <2>
else
forever
show
go to <mouse pointer>
hide

thanks
if you share it I could have a look at the script
dhdguysg
Scratcher
100+ posts

Get background to change when two sprites touch

parq wrote:

Hi powercon5,

i tried your solution but it didnt work for me.
i currently have these blocks on my sprite (cant upload a pic atm):

when backdrop switches to <1>
show
if <touching clock> then
switch backdrop to <2>
else
forever
show
go to <mouse pointer>
hide

thanks
Easy, Put this into the sprite
whenclickedforeveriftouching sprite that you want?TO-DO: Insert the code you want to happen here
parq
Scratcher
7 posts

Get background to change when two sprites touch

powercon5 wrote:

parq wrote:

Hi powercon5,

i tried your solution but it didnt work for me.
i currently have these blocks on my sprite (cant upload a pic atm):

when backdrop switches to <1>
show
if <touching clock> then
switch backdrop to <2>
else
forever
show
go to <mouse pointer>
hide

thanks
if you share it I could have a look at the script


i shared the project for viewing purposes. You can check it out at my profile.

Let me know what you see.
Catsarefun
Scratcher
57 posts

Get background to change when two sprites touch

whenclickedshow
switchbackdroptobackdrop1
foreveriftouchingSprite2?thenswitchbackdroptobackdrop2hidebroadcasthide the other sprite
This should work, parq!
Christians_Games
Scratcher
10 posts

Get background to change when two sprites touch

whenclickedforeveriftouchingsprite2?thenswitchbackdroptobackdrop2
gadgetguy2006
Scratcher
79 posts

Get background to change when two sprites touch

i need help getting the sprite to be able to move while jumping in a platformer

Last edited by gadgetguy2006 (Feb. 7, 2016 11:40:48)

Paddle2See
Scratch Team
1000+ posts

Get background to change when two sprites touch

gadgetguy2006 wrote:

i need help getting the sprite to be able to move while jumping in a platformer
Please make your own topic in this section - look for the New Topic button in the upper right hand area of the screen when you are on the main directory

https://scratch.mit.edu/discuss/7/

Or, you can click this link

https://scratch.mit.edu/discuss/7/topic/add/

Powered by DjangoBB