How to make actor zoom toward nearest magnet.

So in my latest game I need to create an effect very similar to..



I have many ideas of how to do this, (most revolving around magnitude and acceleration/interpolation), but I'm interested to hear what ideas your guys may have before I decide which way is best.

Thanks for any input!
- Thomas

Comments

  • MantoManto Member Posts: 796
    Here's a small demo I made for you. You can replace the white spheres with planets.
  • SnapFireStudiosSnapFireStudios Member Posts: 1,603
    @Manto1 - Thanks so much for the demo!
    What you did was my first thought, but I did not fully explain the situation.
    I need to have multiple magnets but also multiple pieces of metal (the little blue pieces flowing around). So all of these pieces must keep track on their own of which magnet they are nearest too.
    I'm thinking, for inside metal actors:
    When Touching actor Magnet, change self.zoom to true, and then...
    When self.zoom is true, accelerate toward Nearest magnet (how do I determine this?)

    Should I somehow use magnitude or have many different magnet actors like magnet1/2/3 etc?

    Thanks for the help,
    - Thomas
  • MantoManto Member Posts: 796
    @SnapFireStudios Unfortunately actors don't detect multiple collisions so my way won't work with many pieces of metal.
  • SnapFireStudiosSnapFireStudios Member Posts: 1,603
    Try this one:
    http://forums.gamesalad.com/discussion/comment/389695/#Comment_389695
    Awesome! Exactly what I was looking for.
    I was able to modify it to use multiple balls :)
    - Thomas
Sign In or Register to comment.