Discuss Scratch

  • Discussion Forums
  • » Suggestions
  • » you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts [RSS Feed]
rombust
Scratcher
24 posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts
Swampert11
Scratcher
1000+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

There is already a
 

if on edge, bounce
block.
As for the bounce block, it cannot know how to bounce in all circumstances. So, I don't support.

Last edited by Swampert11 (July 31, 2016 16:22:55)

ErnieParke
Scratcher
1000+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

Nice suggestion! It sounds like it would be helpful to various Scratchers. The problem I see with a bounce block though is how are you even going to code that? Different people code their bounces differently, and even the code behind it is complex. It could easily be a source of lag for a project, so I don't support.

My thoughts,

ErnieParke
Zacshap21
Scratcher
100+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

You should be able to put on edge in a if block, then just boulle in another. You could modify it, so on the bounce block, have a drop down menu to set bounce strength to__, set bounce direction to: up, down, left, right, same direction sprite came from. I support it
seanbobe
Scratcher
500+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

noSUPPORT.P.S.mySPACEkeyISbroken.SORRY.
rombust
Scratcher
24 posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

Nice suggestion! It sounds like it would be helpful to various Scratchers. The problem I see with a bounce block though is how are you even going to code that? Different people code their bounces differently, and even the code behind it is complex. It could easily be a source of lag for a project, so I don't support.

My thoughts,

ErnieParke


your right it takes alot of code but its not all active at the same time and it only rarely makes lag

drmcw
Scratcher
1000+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

rombust wrote:

Nice suggestion! It sounds like it would be helpful to various Scratchers. The problem I see with a bounce block though is how are you even going to code that? Different people code their bounces differently, and even the code behind it is complex. It could easily be a source of lag for a project, so I don't support.

My thoughts,

ErnieParke


your right it takes alot of code but its not all active at the same time and it only rarely makes lag

I think the point ErnieParke was trying to make was that it would be impossible for a bounce script to know how to bounce. The screen edge is easy because it is flat and stationary. Sprites are any shape and can be moving, spinning and represent different masses and elasticity so creating a generic bounce block would be impossible and is the reason we have all those other lovely blocks so we can do it ourselves just how we want. No support I'm afraid.

Last edited by drmcw (May 7, 2014 06:48:55)

cutekids100
Scratcher
15 posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

You can code it like this:

when green flag clicked
forever

if <touching [Sprite2 v] ?> then

bounce
end

end
seanbobe
Scratcher
500+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

if <touching color [white(or the color of the background)] ?> then
bounce
end

Last edited by seanbobe (July 18, 2014 19:13:44)

Mr-scratcher3
Scratcher
14 posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

I tried this duplicate, but unfortunatley @paddle2see* decided to shut me down.
Ektor31
New Scratcher
1 post

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

To bounce you can use this :
point in direction (((-1) * (direction)))
theonlygusti
Scratcher
1000+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

Ektor31 wrote:

To bounce you can use this :
point in direction ((-1) * (direction))
Yes, you can.

stickfire-helper
Scratcher
24 posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

Ektor31 wrote:

To bounce you can use this :
point in direction (((-1) * (direction)))
Yes, if you are bouncing off a vertical line.

It is actually possible to make a script that bounces off a line at any angle, or off a circle. Unfortunately it is not possible to bounce off a complex shape this way, which is why there is not a bounce block and there probably never will be.

mitopolis
Scratcher
100+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

SuPpOrT
3sal2
Scratcher
100+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

No, it's not possible. Plus, you'll need calculus for this thing, which Scratch (and probably Flash itself) doesn't support.
tw1ts1
Scratcher
9 posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

If you you want to make stuff bounce off of whatever just do if touching (whatever) move -10 steps.
little_kitten
Scratcher
500+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

No support because if you say forever wait (1) secs, bounce, if it wasn't touching anything, it would bounce off to?
shoresbeep
Scratcher
1000+ posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

No support because:

point in direction ((180) - (direction))
cutekids100
Scratcher
15 posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

How about
if touching [Sprite1 v], bounce ::motion
?
lizardz25
Scratcher
30 posts

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

rombust wrote:

you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts

You could use something like this for bouncing off a red and black line (named Sprite1)

when I receive [ v]
repeat until <[w] = [1]>
if <touching color [#ff0000] ?> then
point in direction ((([sqrt maybe? v] of (direction)) * ((90) + (([sqrt? v] of ([direction v] of [Sprite1 v]))))))
end
if <touching color [#000000] ?> then
point in direction ((([sqrt maybe? v] of (direction)) * ((((90) + (([sqrt? v] of ([direction v] of [Sprite1 v])))))) * (-1)))
end
move (3) steps
end
I don't know if this will work, but I think it should use direction sensing instead of color sensing for the bounce physics.

Last edited by lizardz25 (July 31, 2016 13:40:28)

  • Discussion Forums
  • » Suggestions
  • » you should have a -bounce- block as well as a -if on edge bounce- block as otherwise you have to make complicated scripts [RSS Feed]

Powered by DjangoBB