Discuss Scratch

10yearoldgamers
Scratcher
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)
wbpx9201
Scratcher
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]> then
Broadcast [Change Backdrop V]
End
When I receive [Change Backdrop V]
Switch Backdrop to [Backdrop 2 V]
For touching the edge AND the butterfly, or the edge OR the butterfly, use these blocks:
<() and ()> 
<() or ()>

^ They should have < or > edges.

Last edited by wbpx9201 (Oct. 6, 2013 20:37:15)

drmcw
Scratcher
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
Scratcher
21 posts

How do you make it where if you touch the edge/sprite it will send you you to another background?

wbpx9201 wrote:

if <touching [edge V]> then
Broadcast [Change Backdrop V]
End
When I receive [Change Backdrop V]
Switch Backdrop to [Backdrop 2 V]
For touching the edge AND the butterfly, or the edge OR the butterfly, use these blocks:
<() 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
Scratcher
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
Scratcher
21 posts

How do you make it where if you touch the edge/sprite it will send you you to another background?

scubajerry wrote:

Can you share your project?
the one im working on right now?
JAVAProgramming
Scratcher
100+ posts

How do you make it where if you touch the edge/sprite it will send you you to another background?

10yearoldgamers wrote:

wbpx9201 wrote:

forever
if <touching [edge V]> then
Broadcast [Change Backdrop V]
End
End
When I receive [Change Backdrop V]
Switch Backdrop to [Backdrop 2 V]
For touching the edge AND the butterfly, or the edge OR the butterfly, use these blocks:
<() 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!
You'll need a forever loop so it continually checks if it is touching the edge or the butterfly.

Last edited by JAVAProgramming (Oct. 8, 2013 00:15:09)

RazzleDazzleSwish
New Scratcher
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
crazybox
New Scratcher
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
New Scratcher
1 post

How do you make it where if you touch the edge/sprite it will send you you to another background?

lol
trumpetboy8
Scratcher
27 posts

How do you make it where if you touch the edge/sprite it will send you you to another background?

RazzleDazzleSwish wrote:

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 clicked
forever

if <right arrow pressed> then
change x by (5)

end
end
then vice versa if left arrow pressed move x -5

Last edited by trumpetboy8 (March 3, 2014 23:01:51)

Sonickyle
Scratcher
1000+ posts

How do you make it where if you touch the edge/sprite it will send you you to another background?

lucky69 wrote:

lol
Please don't necrobump topics unless they are still relevant, as this is against the rules.
gumminommi
Scratcher
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
Scratcher
3 posts

How do you make it where if you touch the edge/sprite it will send you you to another background?

hi
thananzernap
Scratcher
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
lalash
Scratcher
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:
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
Scratcher
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 clicked
forever

if <touching [edge v]?> then

switch backdrop to [Needed v]
end
end
And for the movement:
when green flag clicked
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
Hope that helps!
lalash
Scratcher
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
Scratcher
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
Scratcher
3 posts

How do you make it where if you touch the edge/sprite it will send you you to another background?

Thanks!!

Powered by DjangoBB