Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Touching edge, but only some edges
- DenverBroncos16354
- New to Scratch
18 posts
Touching edge, but only some edges
The is a block that says touching edge, and I was wondering if anyone knew a way to make that only work on certain edges. For example I want my ball to bounce off the two horizontal edges but do something else on the vertical ones.
- DenverBroncos16354
- New to Scratch
18 posts
Touching edge, but only some edges
I do know that you can do it with different colors in the background but I was hoping to do it without changing my background
- DD-8861
- Scratcher
100+ posts
Touching edge, but only some edges
Something like this?
if <touching [edge v] ?> then
if <<(x position) > [230]> or <(x position) < [-230]>> then
bounce
else
do other stuff
end
end
- DerpyHead0
- Scratcher
1000+ posts
Touching edge, but only some edges
here's 2 ways
1) put sprites at the edges, and see if touching the sprite
2) check coords of ball to see what edge it's touching
1) put sprites at the edges, and see if touching the sprite
2) check coords of ball to see what edge it's touching
when I start as a clone
delete this clone
- Dbowers2008
- New to Scratch
1 post
Touching edge, but only some edges
For me the x coridannts for my edges were 190 and - 190 and the y coridants were 130 and -130 with the scratch cat have an awesome day Jesus loves you
- Harakou
- Scratcher
1000+ posts
Touching edge, but only some edges
Hi! Thank you for offering your help, but this thread is pretty old - I don't think it's relevant anymore. When you respond to a topic, please make sure it's recent and the original poster still needs an answer. Thanks! For me the x coridannts for my edges were 190 and - 190 and the y coridants were 130 and -130 with the scratch cat have an awesome day Jesus loves you
- Discussion Forums
- » Help with Scripts
- » Touching edge, but only some edges