Discuss Scratch

pizzafox20109
Scratcher
100+ posts

If on (sprite) edge then bounce

My suggestion is simply a block that acts exactly the same as the “if on edge then bounce” block, but it's for sprites and you can choose specifically which sprites, or any sprite.

Recently I built a shading engine that relies on light bouncing, similar to pathtracing algorithms.
In making this I found that there is no easy way to make a sprite bounce off of another sprite, only the edge.
Prince_Toast
Scratcher
96 posts

If on (sprite) edge then bounce

I think a “Bounce” block would do, since you could then code
if <touching [Sprite] ?> then
Bounce
end
-Valtren-
Scratcher
1000+ posts

If on (sprite) edge then bounce

couldn't you just use the workaround for the if on edge bounce block but change it to the sprite?
Itz_Wolfram
Scratcher
66 posts

If on (sprite) edge then bounce

pizzafox20109 wrote:

My suggestion is simply a block that acts exactly the same as the “if on edge then bounce” block, but it's for sprites and you can choose specifically which sprites, or any sprite.

Recently I built a shading engine that relies on light bouncing, similar to pathtracing algorithms.
In making this I found that there is no easy way to make a sprite bounce off of another sprite, only the edge.

You can make a workaround by using x vel and y vel, and multiplying it by negative 1 when touching sprite
reallysoftuser
Scratcher
1000+ posts

If on (sprite) edge then bounce

This has been suggested before: https://scratch.mit.edu/discuss/post/375953
Please move here to keep the discussion in a single place. This post will be closed soon by the Scratch Team.

Powered by DjangoBB