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]
pvz_pro
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, their are too many ways to bounce
Sigton
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

Please don't necropost guys

Sigton
1MatsuLover
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

Sigton wrote:

Please don't necropost guys

Sigton
Reporting this topic to be closed because of this.
elim2020
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 think it would be a good idea.
if touching [sprite v]
would be good, as @cutekids100 said. otherwise, it would be
if touching <>
Ebezz
Scratcher
16 posts

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

point in direction (((-1) * (direction)) v)
Ebezz
Scratcher
16 posts

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

< yolo?>
DaEpikDude
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

bloop

The Stickies wrote:

TheMonsterOfTheDeep wrote:

Because they seem to be cropping up, let me make an offtopic post to clear up some misconceptions about the bounce block…

It's very difficult to make a general “bounce” block, because what it does is reflect the sprite by mirroring its velocity across the line normal to the surface it hits. (Sorry, it's kind of hard to be exactly clear about what it does, so I'm trying to be specific).

However, it's very likely that this block would work imperfectly, at least for bitmap sprites, because the normal line calculated would be more of an “average” normal line than the actual line.

That's not the only problem, of course - the other problem is the question of what to do when the sprite is intersecting (not merely touching the edge of) the other sprite, and what to do when it's touching or intersecting multiple sprites.

The ‘if on edge, bounce’ block is comparatively simple - it merely means that if the sprite is touching or intersecting an edge, reflect across the line perpendicular to that edge in the middle of the sprite, which is really easy to do.

(The reason intersection works for the edge and not for sprites is because the edge is a single line - it's easy to define where the reflection line is, which is straight in the middle of the sprite. However, if it is intersecting a generally shaped object, you also have to calculate the normal line - and where to calculate that is based on where it is touching, which is ambiguous.)

P.S. If you would like to discuss the bounce block more, please make a new topic or find an old one (I'm pretty sure there is at least one old one you can use).
stickfiregames
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

DaEpikDude wrote:

bloop

The Stickies wrote:

TheMonsterOfTheDeep wrote:

Because they seem to be cropping up, let me make an offtopic post to clear up some misconceptions about the bounce block…

It's very difficult to make a general “bounce” block -snip-
Not just difficult, but rejected. The wording of the rejection suggests a bounce off [sprite v] block is still open for consideration, but that's a different suggestion.
  • 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