Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Odp: FLASH: using math to establish relationship between Y coords and scale?
From: axel
Date: Mon, 31 Jul 2000 22:40:49 +0100

> Set Variable: "randomY" = Random (35) + 125
>
> I have to use these coords because this is where the "water" is.
>
> Currently I have used my very limited math to use "randomY" to determine
an
> OK proportionate scale.
>
> Set Variable: "Scale" = int(( randomY / 160) * 100)
>
> The only problem is that "Scale" will only be between 78 and 100 and it
> would be far more realistic that "Scale" be between say 20 and 100. In
> other words I need to make the variation in scale more dramatic.
>
> Is there a nice neat way to use _y ("randomY") to determine a more
dramatic
> "Scale"?

in other words you need random y between 125 and 160 and related scale
between 20 and 100 (or between 0 and 80 plus 20)
for clearity:

make it that way:
"random" = random(35)
"randomY" = random + 125
"scale" = int (( random * 80/35 + 20 ) * 100

80 = 100 - 20 and it is max related to max random 35 -> 80/35

you can also do that way
"randomY" = random(35) + 125
"scale" = int (( (random-125) * 80/35 + 20 ) * 100

axel


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Full flasher archive now available online at:
http://www.chinwag.com/flasher/archive.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: using math to establish relations, Kurt Dommermuth

Replies
  FLASH: loop script, Brack, Jeremy
  FLASH: using math to establish relations, Kurt Dommermuth

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]