Hi everyone I am a scrath noob. I was wondering if anyone knos how to make "sprites" into edges (if even possible). My goal is to make certain areas of the "map" bouncy. For instances if my ship runs into a certain rock, is there a way to make it bounce off? Thanks in advance for any help. Sorry if this is the wrong forum to ask the question.
Offline
There are two options - if sprite 1 touches sprite 2 or sprite 3 or sprite 4 then
(insert bounce code)
for edges if the background is black 0,0,0
make a row around the edge that is 0,0,1 and use if touching color
Offline
if by bounce you need something realistic, it is touch to create in scratch. 2 circuls are quite easy, however anything else becomes quite tough. Ive had a go at something like it, but it was way to complicated for scratch to follow, and it lagged and bugged.
Offline
Bouncing off of an irregularly shapped object is quite a challenge. First, you have to figure out what the normal vector to the surface is, at the position of impact, then calculate the bounce. It's the figuring out of the normal vector that is hard.
If you work with flat or circular surfaces, it's easier; take a look at my Ricochet Mini Golf which does bounces off of slanted straight surfaces and circular posts.
http://scratch.mit.edu/projects/Paddle2See/82463
I have played around with bounces off or an irregular surface...I've gotten it to work fairly well but it's kind of slow, unless you use motion buffering (which probably wouldn't work for what you want to do). You can see my experiment here:
http://scratch.mit.edu/projects/Paddle2SeeFixIt/285753
Good luck!
Offline
thanks everyone
Offline