This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-03-27 18:06:42

Quaggledorf
Scratcher
Registered: 2009-03-27
Posts: 7

Hello. I have a quick question

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

 

#2 2009-03-27 18:13:28

Mike_W
Scratcher
Registered: 2009-02-05
Posts: 100+

Re: Hello. I have a quick question

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

 

#3 2009-03-28 05:30:04

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Hello. I have a quick question

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

 

#4 2009-03-28 06:42:28

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Hello. I have a quick question

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!


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#5 2009-05-28 17:55:19

Quaggledorf
Scratcher
Registered: 2009-03-27
Posts: 7

Re: Hello. I have a quick question

thanks everyone

Offline

 

Board footer