Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » how to make a sprite bounce of off another
- catnip202001
-
Scratcher
4 posts
how to make a sprite bounce of off another
the code of the
please avoid any of the following code
if on edge, bouncebut instead of it bouncing on the edge, does anyone know a way to make it bounce of off a certain colour, or a certain sprite, like a wall sprite, not a small sprite.
please avoid any of the following code
if <touching [sprite v] ?> then
turn cw (180) degrees
end
forever
if <touching [sprite v] ?> then
point in direction ((direction) * (-1))
end
end
Last edited by catnip202001 (Nov. 13, 2024 11:06:14)
- 8to16
-
Scratcher
1000+ posts
how to make a sprite bounce of off another
maybe this works?
i should stop forgetting to sign my posts
8to16
if <touching (sprite wanted v) ?> then
turn cw (180) degrees
end
i should stop forgetting to sign my posts
8to16
Last edited by 8to16 (Nov. 13, 2024 10:33:10)
- catnip202001
-
Scratcher
4 posts
how to make a sprite bounce of off another
i get that, but all that does is turn the sprite around entirely, but you will see with the
if on edge, bounceif the sprite is moving at an angle of 45 degrees, it will bounce of off the edge at -45, which is not a full 180 turn around.
- Discussion Forums
- » Questions about Scratch
-
» how to make a sprite bounce of off another