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

#1 2011-08-21 08:01:50

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Bigger When Closer

How would you make a sound louder if it was closer to the object, but smaller if it's further away?

Offline

 

#2 2011-08-21 08:40:10

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Bigger When Closer

Distance to, I suppose.

Offline

 

#3 2011-08-21 08:42:06

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Bigger When Closer

scimonster wrote:

Distance to, I suppose.

That's the opposite of what i want to happen.

Offline

 

#4 2011-08-21 08:48:00

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Bigger When Closer

Code:

set volume to ((100)-(distance to []))

Offline

 

#5 2011-08-21 09:14:29

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Bigger When Closer

Thanks!

Offline

 

#6 2011-08-21 11:13:00

4lover
Scratcher
Registered: 2010-04-24
Posts: 500+

Re: Bigger When Closer

scimonster wrote:

Code:

set volume to ((100)-(distance to []))

yep thats the correct way


Check out this awesome new zombie-cod type of game: http://scratch.mit.edu/projects/4lover/1975649

Offline

 

#7 2011-08-21 14:48:03

woofwoof301
Scratcher
Registered: 2008-06-01
Posts: 100+

Re: Bigger When Closer

4lover wrote:

scimonster wrote:

Code:

set volume to ((100)-(distance to []))

yep thats the correct way

there's a volume block? or is that supposed to be a variable?

Offline

 

#8 2011-08-21 14:58:33

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Bigger When Closer

Block

Offline

 

#9 2011-08-21 17:15:36

4lover
Scratcher
Registered: 2010-04-24
Posts: 500+

Re: Bigger When Closer

yeagh thats a block


Check out this awesome new zombie-cod type of game: http://scratch.mit.edu/projects/4lover/1975649

Offline

 

#10 2011-08-22 03:26:22

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Bigger When Closer

woofwoof301 wrote:

4lover wrote:

scimonster wrote:

Code:

set volume to ((100)-(distance to []))

yep thats the correct way

there's a volume block? or is that supposed to be a variable?

http://wiki.scratch.mit.edu/images/Set_Volume_to_%28%29.png

Offline

 

#11 2011-08-22 12:47:25

woofwoof301
Scratcher
Registered: 2008-06-01
Posts: 100+

Re: Bigger When Closer

OOOHHH!!! THAT volume!! Lol, woof fails again. I thought the topic was talking about size, not soun. Fail.  tongue

Never mind me.

Offline

 

#12 2011-08-22 13:01:46

Kileymeister_test
Scratcher
Registered: 2010-01-31
Posts: 100+

Re: Bigger When Closer

Instead of subtraction, I suggest you use division, like 100/distance, to make it smoother and more gradual.  Plus it then avoids negative volumes.  Just make sure to add a qualifier when distance is 0.


Kileymeister's test account.  I upload engines and demos and stuff for public use.
Currently Working on: Grapple Arms!

Offline

 

Board footer