Discuss Scratch
- Discussion Forums
- » Suggestions
- » What the if on edge, bounce block should be replaced with
- 9kiwi9
- Scratcher
100+ posts
What the if on edge, bounce block should be replaced with
bounce::motionand
<on edge?::motion>Someone could easily recreate the old block using
if <on edge?::motion> then
bounce::motion
end
- Tramcrazy
- Scratcher
100+ posts
What the if on edge, bounce block should be replaced with
Which way would it bounce if it wasn't touching the edge.
(On edge? :: motion)This can already be done like this:<touching [edge v]?>
-Tramcrazy
PS: Apologies for any errors in the above post.
Links:
The Commute: Test your mouse skills by getting the car to its destination.
Interactive characters: Converse with a pair of fictional character who react to what you say.
Magic 8 ball: What is your fortune?
Randomized mental maths test: Test your brain.
A signature is a small piece of text that is attached to your posts. In it, you can enter just about anything you like.
- VoltageGames
- Scratcher
1000+ posts
What the if on edge, bounce block should be replaced with
Like tram pointed out, touching edge already exists. It's a basic block.
But I DO support the bounce part. It's something that would make collision easy for new scratchers.
But I DO support the bounce part. It's something that would make collision easy for new scratchers.
if <touching [wall1 v]?> then
bounce::motion
end
- AonymousProfessor
- Scratcher
100+ posts
What the if on edge, bounce block should be replaced with
What would “bounce” do?
EDIT: Also, what would the following do?
EDIT: Also, what would the following do?
when gf clicked
go to x:(0) y:(0)
forever
bounce :: motion
end
Last edited by AonymousProfessor (April 10, 2014 21:51:18)
I am @AonymousGuy's test account!
The word “test” in test accounts is outdated. That is why mine has professor instead!
Thanks @MicroMacro for the profile image!
- Greatguy123
- Scratcher
500+ posts
What the if on edge, bounce block should be replaced with
Support.
There could also be a I think there should be anif touching [edge v], bounce :: motion
if touching color [#f0f] bounce // category=motionI wish there could just be a bounce block, but as spgame05 put it,
You can't bounce off of nothing!
The evil if block is hungry! >:-D
- Deerleg
- Scratcher
1000+ posts
What the if on edge, bounce block should be replaced with
Yes. And Support.There could also be a I think there should be anif touching [edge v], bounce :: motionif touching color [#f0f] bounce // category=motionI wish there could just be a bounce block, but as spgame05 put it,You can't bounce off of nothing!
would probably do nothing. What would “bounce” do?
EDIT: Also, what would the following do?when gf clicked
go to x:(0) y:(0)
forever
bounce :: motion
end
- snake-2
- Scratcher
100+ posts
What the if on edge, bounce block should be replaced with
Support
The glow of one warm thought is worth to me more than money-Thomas Jefferson
My profile
forever
think [Remember: Think this and think that and think low and think high, oh the things you can think if you only try!]
end
- derpmeup
- Scratcher
1000+ posts
What the if on edge, bounce block should be replaced with
I think there should be anif touching [edge v], bounce :: motionblock instead. You can't bounce off of nothing!
Yeah, so do I.
hey bro that's a pretty good meme xD!
- seanbobe
- Scratcher
500+ posts
What the if on edge, bounce block should be replaced with
turn blank () degreessame same
bounce
- A-no-meep
- Scratcher
100+ posts
What the if on edge, bounce block should be replaced with
How would an object bounce on a really crooked set of bitmap spikes?I think there should be anif touching [edge v], bounce :: motionblock instead. You can't bounce off of nothing!
Yeah, so do I.
[ v]A dropdown to nowhere
- 1234abcdcba4321
- Scratcher
1000+ posts
What the if on edge, bounce block should be replaced with
Just “bounce” wouldn't work well.
Instead, this would…
Instead, this would…
if <>, bounce ::motion
I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
- spgame05
- Scratcher
100+ posts
What the if on edge, bounce block should be replaced with
How would that work? What would Just “bounce” wouldn't work well.
Instead, this would…if <>, bounce ::motion
if <[1] = [1]>, bounce ::motiondo? I think we should have my idea of
if touching [edge v], bounce :: motionand Greatguy123's idea of
if touching color [#f0f], bounce :: motioninstead.
- derpmeup
- Scratcher
1000+ posts
What the if on edge, bounce block should be replaced with
There is an easy workaround for this.if touching color [#f0f], bounce :: motion
when green flag clicked
forever
if <touching color [#f0f]?> then
if <(x position) > [0]> then
change x by (-50)
else
if <(x position) < [0]> then
change x by (50)
end
end
end
end
Last edited by derpmeup (April 13, 2014 00:51:48)
hey bro that's a pretty good meme xD!
- ExtremeLogic
- Scratcher
500+ posts
What the if on edge, bounce block should be replaced with
I think “bounce” is more pointed towards rotation.There is an easy workaround for this.if touching color [#f0f], bounce :: motionwhen green flag clicked
forever
if <touching color [#f0f]?> then
if <(x position) > [0]> then
change x by (-50)
else
if <(x position) < [0]> then
change x by (50)
end
end
end
end
if touching color [#f0f], bounce :: motionwhen green flag clicked
forever
if <touching color [#f0f]?> then
turn right (180) degrees
end
end
- 1234abcdcba4321
- Scratcher
1000+ posts
What the if on edge, bounce block should be replaced with
I still like mine.How would that work? What would Just “bounce” wouldn't work well.
Instead, this would…if <>, bounce ::motionif <[1] = [1]>, bounce ::motiondo? I think we should have my idea ofif touching [edge v], bounce :: motionand Greatguy123's idea ofif touching color [#f0f], bounce :: motioninstead.
The block needs a boolean statement, which is why just a regular bounce wouldn't work.
I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
- pnixon63
- New to Scratch
4 posts
What the if on edge, bounce block should be replaced with
Like tram pointed out, touching edge already exists. It's a basic block.
But I DO support the bounce part. It's something that would make collision easy for new scratchers.if <touching [wall1 v]?> then
bounce::motion
end
I would like a bounce block that would bounce off objects depending on the angle it approaches (I don't quite understand why direction isn't measured 0-360 degrees). I am just a novice and I have tried making my own Breakout game. The best code I found to deal with it are in this project.
However I do take on the fact that:
How would an object bounce on a really crooked set of bitmap spikes?
- 3sal2
- Scratcher
100+ posts
What the if on edge, bounce block should be replaced with
There's no way you could bounce off a general shape without calculus. And, as A-no-meep said, there would be an issue with diagonal bitmap surfaces.
Let 0 be the surface, 1 be the impactor, and represent all other pixels. It will look like this before impact:
0
00 1
000 111
0000 1
00000
000000
0000000
00000000
000000000
If the impactor continues to move, say, southwest, it will look like this:
0
00
000
0000 1
00000111
0000001
0000000
00000000
000000000
But what will it do? It can't determine an orientation. If it had to randomly choose from up or right, it would look wonky regardless of the outcome:
0 1
00 111
000 1
0000
00000
000000
0000000
00000000
000000000
This violates the laws of reflection! If it was a bigger diamond-shape or octagon, it would get stuck. If it touched the surface by the corners, it wouldn't be able to find an orientation. If it decides to reflect back, it will again violate the laws of reflection for any surface that is not “perpendicular” to the impactor's “direction”.
The only way to determine the “angle” of the bitmap surface is to analyze the surrounding pixels and estimate the reflection angle, which, again, requires the use of calculus.
However, this is not an issue with vectors, as you can design a program with an extra sprite that measures the orientation and tells the shape which way to go.
Let 0 be the surface, 1 be the impactor, and represent all other pixels. It will look like this before impact:
0
00 1
000 111
0000 1
00000
000000
0000000
00000000
000000000
If the impactor continues to move, say, southwest, it will look like this:
0
00
000
0000 1
00000111
0000001
0000000
00000000
000000000
But what will it do? It can't determine an orientation. If it had to randomly choose from up or right, it would look wonky regardless of the outcome:
0 1
00 111
000 1
0000
00000
000000
0000000
00000000
000000000
This violates the laws of reflection! If it was a bigger diamond-shape or octagon, it would get stuck. If it touched the surface by the corners, it wouldn't be able to find an orientation. If it decides to reflect back, it will again violate the laws of reflection for any surface that is not “perpendicular” to the impactor's “direction”.
The only way to determine the “angle” of the bitmap surface is to analyze the surrounding pixels and estimate the reflection angle, which, again, requires the use of calculus.
However, this is not an issue with vectors, as you can design a program with an extra sprite that measures the orientation and tells the shape which way to go.
- Diamond_Projects
- Scratcher
100+ posts
What the if on edge, bounce block should be replaced with
bounce :: motionWhaaaa? Bounce of what angle? What edge? And what if it is touching two things?
Last edited by Diamond_Projects (Nov. 16, 2014 02:41:33)
- Diamond_Projects
- Scratcher
100+ posts
What the if on edge, bounce block should be replaced with
There's no way you could bounce off a general shape without calculus. And, as A-no-meep said, there would be an issue with diagonal bitmap surfaces.
Let 0 be the surface, 1 be the impactor, and represent all other pixels. It will look like this before impact:
0
00 1
000 111
0000 1
00000
000000
0000000
00000000
000000000
If the impactor continues to move, say, southwest, it will look like this:
0
00
000
0000 1
00000111
0000001
0000000
00000000
000000000
But what will it do? It can't determine an orientation. If it had to randomly choose from up or right, it would look wonky regardless of the outcome:
0 1
00 111
000 1
0000
00000
000000
0000000
00000000
000000000
This violates the laws of reflection! If it was a bigger diamond-shape or octagon, it would get stuck. If it touched the surface by the corners, it wouldn't be able to find an orientation. If it decides to reflect back, it will again violate the laws of reflection for any surface that is not “perpendicular” to the impactor's “direction”.
The only way to determine the “angle” of the bitmap surface is to analyze the surrounding pixels and estimate the reflection angle, which, again, requires the use of calculus.
However, this is not an issue with vectors, as you can design a program with an extra sprite that measures the orientation and tells the shape which way to go.Please do not necropost.(bounce :: motion)Whaaaa? Bounce of what angle? What edge? And what if it is touching two things?
I'm telling you why the “bounce” block won't work! How is that a necropost?
- Discussion Forums
- » Suggestions
- » What the if on edge, bounce block should be replaced with