Opposite of Magnitude?

m456arcusm456arcus Member Posts: 189
edited November -1 in Working with GS (Mac)
Ok. I've got a player actor and a depth charge that floats down slowly. Each charge calculates it's distance from the player with the magnitude function; as they get closer the value goes down. The charges also start with a random fuse length before they explode wherever they happen to be.

So, here's my issue. And it might be simple, but I can't figure it out. When the charge explodes, I want the health deducted to be proportional to the distance from the player. How could I efficiently go about doing this when magnitude goes up as distance increases, not down like I want?

Comments

  • AsymptoteellAsymptoteell Member Posts: 1,362
    You're gonna want something like change health to health-(500/magnitude(blahblahblah))
    That will be an inverse function, and as magnitude goes up, health decreased will go down.
  • m456arcusm456arcus Member Posts: 189
    Nicely done, works perfectly. Although, I do feel kinda stupid after realizing it was simple division... My excuse is that it's Friday.
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Are you gettin' down on friday?
    At least tomorrow is saturday, and sunday comes afterwards.
  • m456arcusm456arcus Member Posts: 189
    LOL I was a couple seconds from posting that in my second post, that's the funniest thing I've ever seen. It really doesn't make any sense at all.

    Partying, Partying, Yeah!!
  • AsymptoteellAsymptoteell Member Posts: 1,362
    which seat can i take?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Asymptoteell said:
    Are you gettin' down on friday?
    At least tomorrow is saturday, and sunday comes afterwards.


    Wow...
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Asymptoteell said:
    Are you gettin' down on friday?
    At least tomorrow is saturday, and sunday comes afterwards.


    At least we know iTunes isn't just cluttered with crappy apps. OMG WTF do kids really call that music?
  • AsymptoteellAsymptoteell Member Posts: 1,362
    No. Nobody thinks it's good at all. It got successful because it's a total joke.
    Kickin' in the front seat
    Sittin' in the back seat
    Which seat can I take?

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Pure poetry.
Sign In or Register to comment.