Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do you make it where if you touch the edge/sprite it will send you you to another background?
- 10yearoldgamers
-
21 posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
How do you make it where if you touch the edge/sprite it will send you you to another background?
me and my friend are trying to make a game where if you touch a butterfly it will say Game over on a backdrop and ik how to make a backdrop and stuff its just i need help with the scrpt part basically if it touches the edge or butterfly so if you could help thx!
(PS she came up the the game, not me xD)
me and my friend are trying to make a game where if you touch a butterfly it will say Game over on a backdrop and ik how to make a backdrop and stuff its just i need help with the scrpt part basically if it touches the edge or butterfly so if you could help thx!
(PS she came up the the game, not me xD)
- wbpx9201
-
100+ posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
if <touching [edge V]> thenFor touching the edge AND the butterfly, or the edge OR the butterfly, use these blocks:
Broadcast [Change Backdrop V]
End
When I receive [Change Backdrop V]
Switch Backdrop to [Backdrop 2 V]
<() and ()>
<() or ()>
^ They should have < or > edges.
Last edited by wbpx9201 (Oct. 6, 2013 20:37:15)
- drmcw
-
1000+ posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
If you're using version 2 then you don't need the broadcast you can just use;
switch backdrop to [ backdrop1 v]
- 10yearoldgamers
-
21 posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
if <touching [edge V]> thenFor touching the edge AND the butterfly, or the edge OR the butterfly, use these blocks:
Broadcast [Change Backdrop V]
End
When I receive [Change Backdrop V]
Switch Backdrop to [Backdrop 2 V]<() and ()>
<() or ()>
^ They should have < or > edges.
I did it exactly right so when they touched it didnt work! it went right through and the buttetflys are moving towards it so idk if thats a problem or not so if you got an other suggestions that would help a lot!
- scubajerry
-
1000+ posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
Can you share your project?
- 10yearoldgamers
-
21 posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
the one im working on right now? Can you share your project?
- JAVAProgramming
-
100+ posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
You'll need a forever loop so it continually checks if it is touching the edge or the butterfly.foreverFor touching the edge AND the butterfly, or the edge OR the butterfly, use these blocks:
if <touching [edge V]> then
Broadcast [Change Backdrop V]
End
End
When I receive [Change Backdrop V]
Switch Backdrop to [Backdrop 2 V]<() and ()>
<() or ()>
^ They should have < or > edges.
I did it exactly right so when they touched it didnt work! it went right through and the buttetflys are moving towards it so idk if thats a problem or not so if you got an other suggestions that would help a lot!
Last edited by JAVAProgramming (Oct. 8, 2013 00:15:09)
- RazzleDazzleSwish
-
1 post
How do you make it where if you touch the edge/sprite it will send you you to another background?
Thanks that was helpful for me as well but then when I got to the new backdrop, my sprite then wouldnt move.
What do I need to do?
Thanks
What do I need to do?
Thanks
- crazybox
-
1 post
How do you make it where if you touch the edge/sprite it will send you you to another background?
Done thanks!
- lucky69
-
1 post
How do you make it where if you touch the edge/sprite it will send you you to another background?
lol

- trumpetboy8
-
27 posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
Thanks that was helpful for me as well but then when I got to the new backdrop, my sprite then wouldnt move.
What do I need to do?
Thanks
when green flag clickedthen vice versa if left arrow pressed move x -5
forever
if <right arrow pressed> then
change x by (5)
end
end
Last edited by trumpetboy8 (March 3, 2014 23:01:51)
- Sonickyle
-
1000+ posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
Please don't necrobump topics unless they are still relevant, as this is against the rules. lol
- gumminommi
-
15 posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
if <touching [ edge]?> then
switch backdrop to [ yourbackdrop]
end
or
if <touching [ yoursprite]?> then
switch backdrop to [ yourbackdrop]
end
- thananzernap
-
3 posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
hi
- thananzernap
-
3 posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
I'm new, and I am trying to make a penguin walk, then go to another backdrop, then eat a fish. This is what I have so far. It isn't working. It won't go to another backdrop. Here's the link to a presentation with what I have so far. Please help!
https://docs.google.com/a/jeffcoschools.us/presentation/d/1bkrqeQoBxYr2O7jdV8nVoVSZyvJaHTjcg99WFQVXNbQ/edit#slide=id.g32f332869_011
https://docs.google.com/a/jeffcoschools.us/presentation/d/1bkrqeQoBxYr2O7jdV8nVoVSZyvJaHTjcg99WFQVXNbQ/edit#slide=id.g32f332869_011
- lalash
-
25 posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
Because you haven't connected the edge script to a hat block. So do this:
I am new to scratch too!
when green flag clicked
forever
if <touching [edge v]?> then
broadcast [Change Backdrop to #2 v]
end
end
I am new to scratch too!
Last edited by lalash (April 26, 2014 18:36:22)
- levtey
-
100+ posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
when green flag clickedAnd for the movement:
forever
if <touching [edge v]?> then
switch backdrop to [Needed v]
end
end
when green flag clickedHope that helps!
forever
if <key [up v] pressed?> then
change y by (a number)
end
if <key [down v] pressed?> then
change y by (-same number)
end
if <key [right v] pressed?> then
change x by (same number)
end
if <key [left v] pressed?> then
change x by (-same number)
end
end
- lalash
-
25 posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
or for the movement you could also do this:
forever
if <key [up arrow ] pressed?> then
change y by (5)
end
if <key [down arrow ] pressed?> then
change y by (-5)
end
if <key [right arrow ] pressed?> then
change x by (5)
end
if <key [left arrow ] pressed?> then
change x by (-5)
end
end
Last edited by lalash (April 26, 2014 18:30:04)
- miles854
-
100+ posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
This is a problem with scripts I need help with too. I am glad this forum is here.
- thananzernap
-
3 posts
How do you make it where if you touch the edge/sprite it will send you you to another background?
Thanks!!


- Discussion Forums
- » Help with Scripts
-
» How do you make it where if you touch the edge/sprite it will send you you to another background?