Accelerate Away From

App SurgeApp Surge Member Posts: 651
edited November -1 in Working with GS (Mac)
An attribute (B) that will be like accelerate toward, except the opposite.

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    You can use a move behavior in an actor:
    Direction: vectorToAngle( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y )
    Relative To: Scene
    Move Type: additive
    Speed: 10*(300/magnitude( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y ))

    You can mess with the "10" and "300" until you get the right amount of repulsion from the mouse.

    Hope this helps!
  • CloudsClouds Member Posts: 1,599
    . . . or simply make your 'accelerate toward' values negative.
Sign In or Register to comment.