Multiballs speed

Discuss Lemur and share techniques.
Post Reply
alloedee
Regular
Posts: 55
Joined: 29 Dec 2012 12:35

Multiballs speed

Post by alloedee »

Hello there.

Iam working on a project using multiple multiballs, with a knob that controlling the speed of the multiballs (same as iPad - Bouncing XY Balls) But I cant figure out how I can lower the values of the knob, so It is only controlling the speed values at very low speed (ect. 0.01-0.1) I dont need the balls to bouncing around at high speed.

Hope It makes any sense

Thx alloede
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Multiballs speed

Post by Softcore »

x*0.1 will give you output in a range of 0 - 0.1 ;)
nitefish
Regular
Posts: 56
Joined: 24 Aug 2012 07:43

Re: Multiballs speed

Post by nitefish »

and
range(Fader.x, 0.01, 0.1)
if you don't want to reach zero.
alloedee
Regular
Posts: 55
Joined: 29 Dec 2012 12:35

Re: Multiballs speed

Post by alloedee »

Sorry but iam a total n00b. Where should I put these lines?
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Multiballs speed

Post by Softcore »

How are you using the knob to control the MultiBall's speed?
alloedee
Regular
Posts: 55
Joined: 29 Dec 2012 12:35

Re: Multiballs speed

Post by alloedee »

Iam using the iPad - Bouncing XY Balls project
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Multiballs speed

Post by Softcore »

Ok sorry for the delay...here's how you fix it.....

Using the PC-Mac editor, first of all select one of the multiball objects....go to the "objects" window and select "behavior" tab.
Now notice that in the "speed" attribute it is typed:

Code: Select all

(Speed.x*4.5)-2.25
What this does is, it takes the knob "Speed" x and "transforms it into values ranging from -2.25 to 2.25

example:
for x=0, (knob full left) speed=(0*4.5)-2.25=-2.25
for x=0.5 (knob at middle) speed=0.5*4.5-2.25=0
for x=1 (knob at full right) speed=1*4.5-2.25=2.25
Remember that the "working" range for Speed is from -5 to 5 so by default, the template provides half the maximum speed a multiball could have.

Of course, you need even slower as you said so....

....lets say you wanted a range of -1 to 1. You change the above equation to this:

Code: Select all

(Speed.x*2)-1
If you dont even want "negative" speed, you can just type

Code: Select all

Speed.x

Once you are finished with a range you like fo rone multiball project, copy-paste your final equation to the other 3 multiball objects too. Finally, the knob will still display the "old" -2.25 to 2.25 range. To fix this, select the speed knob and ungroup it from the - and + texts so that you can edit its properties. Once you 've ungrouped it, select in the "objects" window the "properties" tab - there, by sheer coincidence ( Im kidding of course :P ) you will see that the "value" property has the same equation that the multiballs used to have. Insert here again, your own equation (the one you have typed in the multiballs) and you are done. In this case you dont need to type Speed.x - you just type x.

;)
Post Reply